💄 chore: Optimize some styles

This commit is contained in:
jarvis2f 2025-02-15 20:20:17 +08:00
parent 4ee6661cd6
commit 537fef36e9
9 changed files with 21 additions and 12 deletions

View file

@ -50,7 +50,8 @@ export default function About() {
<CardHeader> <CardHeader>
<CardTitle className="text-white">About This Project</CardTitle> <CardTitle className="text-white">About This Project</CardTitle>
<CardDescription className="text-white"> <CardDescription className="text-white">
A simple telegram file downloader. A self-hosted Telegram file downloader for continuous, stable, and
unattended downloads.
</CardDescription> </CardDescription>
</CardHeader> </CardHeader>
<CardContent className="relative"> <CardContent className="relative">

View file

@ -33,8 +33,8 @@ function FileName({ file }: { file: TelegramFile }) {
return ( return (
<SpoiledWrapper hasSensitiveContent={file.hasSensitiveContent}> <SpoiledWrapper hasSensitiveContent={file.hasSensitiveContent}>
<p className="flex items-center gap-2"> <p className="flex items-center gap-2">
<Mountain className="h-4 w-4" /> <Mountain className="h-4 w-4 flex-shrink-0" />
<span className="rounded px-1 text-sm hover:bg-gray-100 dark:hover:bg-gray-800"> <span className="overflow-hidden truncate text-ellipsis rounded px-1 text-sm hover:bg-gray-100 dark:hover:bg-gray-800">
{file.fileName} {file.fileName}
</span> </span>
</p> </p>
@ -109,13 +109,14 @@ function FilePath({ file }: { file: TelegramFile }) {
} }
function FileTime({ file }: { file: TelegramFile }) { function FileTime({ file }: { file: TelegramFile }) {
const isMobile = useIsMobile();
return ( return (
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Tooltip> <Tooltip>
<TooltipTrigger asChild> <TooltipTrigger asChild>
<p className="flex items-center gap-2"> <p className="flex items-center gap-2">
<Clock className="h-4 w-4" /> <Clock className="h-4 w-4 flex-shrink-0" />
<span className="rounded px-1 text-sm text-muted-foreground hover:bg-gray-100 dark:hover:bg-gray-800"> <span className="rounded px-1 text-sm hover:bg-gray-100 dark:hover:bg-gray-800">
{formatDistanceToNow(new Date(file.date * 1000), { {formatDistanceToNow(new Date(file.date * 1000), {
addSuffix: true, addSuffix: true,
})} })}
@ -128,7 +129,7 @@ function FileTime({ file }: { file: TelegramFile }) {
</div> </div>
</TooltipContent> </TooltipContent>
</Tooltip> </Tooltip>
{file.completionDate && ( {!isMobile && file.completionDate && (
<Tooltip> <Tooltip>
<TooltipTrigger asChild> <TooltipTrigger asChild>
<p className="flex items-center gap-2"> <p className="flex items-center gap-2">

View file

@ -129,7 +129,7 @@ export function FileFilters({
}, [search, handleSearchChange]); }, [search, handleSearchChange]);
return ( return (
<div className="mb-6 flex flex-col justify-between md:flex-row"> <div className="mb-6 flex flex-col flex-wrap gap-2 justify-between md:flex-row">
<div className="grid grid-cols-3 gap-4 md:flex md:flex-row"> <div className="grid grid-cols-3 gap-4 md:flex md:flex-row">
<div className="relative col-span-3"> <div className="relative col-span-3">
<Input <Input

View file

@ -235,7 +235,7 @@ const FileStatistics: React.FC<FileStatisticsProps> = ({ telegramId }) => {
<div className="flex-1 rounded-lg bg-white p-4 shadow-md dark:bg-gray-900"> <div className="flex-1 rounded-lg bg-white p-4 shadow-md dark:bg-gray-900">
<div className="flex items-center space-x-3 border-gray-200 dark:border-gray-700"> <div className="flex items-center space-x-3 border-gray-200 dark:border-gray-700">
<h3 className="text-md flex items-center space-x-2 font-semibold text-gray-700 dark:text-gray-200"> <h3 className="text-md text-nowrap flex items-center space-x-2 font-semibold text-gray-700 dark:text-gray-200">
<Clock className="h-5 w-5 text-yellow-500" /> <Clock className="h-5 w-5 text-yellow-500" />
<span>Speed Statistics</span> <span>Speed Statistics</span>
<span className="text-sm font-medium text-gray-500 dark:text-gray-400"> <span className="text-sm font-medium text-gray-500 dark:text-gray-400">

View file

@ -12,6 +12,7 @@ import {
Pause, Pause,
XCircle, XCircle,
} from "lucide-react"; } from "lucide-react";
import useIsMobile from "@/hooks/use-is-mobile";
export const DOWNLOAD_STATUS = { export const DOWNLOAD_STATUS = {
idle: { idle: {
@ -80,6 +81,7 @@ export default function FileStatus({
}, },
exit: { opacity: 0, scale: 0.9, transition: { duration: 0.2 } }, exit: { opacity: 0, scale: 0.9, transition: { duration: 0.2 } },
}; };
const isMobile = useIsMobile();
return ( return (
<div <div
@ -99,6 +101,7 @@ export default function FileStatus({
className={cn( className={cn(
"text-xs hover:bg-gray-200", "text-xs hover:bg-gray-200",
DOWNLOAD_STATUS[file.downloadStatus].className, DOWNLOAD_STATUS[file.downloadStatus].className,
isMobile && "shadow-none",
)} )}
> >
{DOWNLOAD_STATUS[file.downloadStatus].text} {DOWNLOAD_STATUS[file.downloadStatus].text}

View file

@ -47,7 +47,7 @@ export function Header() {
return ( return (
<Card className="mb-6"> <Card className="mb-6">
<CardContent className="p-4"> <CardContent className="p-4">
<div className="relative flex flex-col items-start justify-between gap-4 md:flex-row md:items-center"> <div className="relative flex flex-col flex-wrap items-start justify-between gap-4 md:flex-row md:items-center">
<div className="flex w-full flex-1 flex-col gap-4 md:flex-row md:items-center"> <div className="flex w-full flex-1 flex-col gap-4 md:flex-row md:items-center">
<Link href={"/"} className="hidden md:inline-flex"> <Link href={"/"} className="hidden md:inline-flex">
<TelegramIcon className="h-6 w-6" /> <TelegramIcon className="h-6 w-6" />

View file

@ -30,7 +30,9 @@ export default function ProxyPing({ accountId }: { accountId: string }) {
> >
<ChevronsLeftRightEllipsis className="h-4 w-4 text-gray-500" /> <ChevronsLeftRightEllipsis className="h-4 w-4 text-gray-500" />
{isLoading && ( {isLoading && (
<div className="h-6 w-16 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div> <div className="h-6 w-14 animate-pulse rounded bg-gray-200 dark:bg-gray-700">
testing
</div>
)} )}
{!isLoading && error && <span>Failed</span>} {!isLoading && error && <span>Failed</span>}
{!isLoading && data && ( {!isLoading && data && (

View file

@ -47,7 +47,7 @@ export const SettingsDialog: React.FC = () => {
defaultValue="general" defaultValue="general"
className="mt-3 flex h-full flex-col overflow-hidden" className="mt-3 flex h-full flex-col overflow-hidden"
> >
<TabsList className="justify-start"> <TabsList className="justify-start overflow-auto">
<TabsTrigger value="general">General</TabsTrigger> <TabsTrigger value="general">General</TabsTrigger>
<TabsTrigger value="statistics">Statistics</TabsTrigger> <TabsTrigger value="statistics">Statistics</TabsTrigger>
<TabsTrigger value="proxys">Proxys</TabsTrigger> <TabsTrigger value="proxys">Proxys</TabsTrigger>

View file

@ -9,12 +9,14 @@ import {
ToastTitle, ToastTitle,
ToastViewport, ToastViewport,
} from "@/components/ui/toast"; } from "@/components/ui/toast";
import useIsMobile from "@/hooks/use-is-mobile";
export function Toaster() { export function Toaster() {
const { toasts } = useToast(); const { toasts } = useToast();
const isMobile = useIsMobile();
return ( return (
<ToastProvider> <ToastProvider duration={isMobile ? 1000 : 5000}>
{toasts.map(function ({ id, title, description, action, ...props }) { {toasts.map(function ({ id, title, description, action, ...props }) {
return ( return (
<Toast key={id} {...props}> <Toast key={id} {...props}>