From c60b827262710f6049ec2d48dff7e6e166145995 Mon Sep 17 00:00:00 2001 From: opsx Date: Sat, 31 Oct 2026 22:52:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(settings):=20=E5=AE=9A=E6=97=B6=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=BB=E9=A2=98=E5=8E=BB=E6=8E=89=E6=97=B6=E5=8C=BA?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E4=B8=8E=E8=AF=B4=E6=98=8E=E6=96=87=E5=AD=97?= =?UTF-8?q?,=E5=9B=BA=E5=AE=9A=E7=94=A8=E6=B5=8F=E8=A7=88=E5=99=A8?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E6=97=B6=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/i18n/locales/en/settings.ts | 4 --- frontend/src/i18n/locales/zh/settings.ts | 4 --- .../settings/components/ThemeSection.tsx | 27 ++----------------- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/frontend/src/i18n/locales/en/settings.ts b/frontend/src/i18n/locales/en/settings.ts index 7365a9c..8328ca2 100644 --- a/frontend/src/i18n/locales/en/settings.ts +++ b/frontend/src/i18n/locales/en/settings.ts @@ -137,10 +137,6 @@ export default { dark: 'Dark', system: 'Follow System', auto: 'Scheduled', - timezone: 'Timezone', - timezoneAria: 'Theme schedule timezone', - browser: 'Follow browser (local)', - autoHint: 'Light from {{start}}:00–{{end}}:00 in the chosen timezone, dark otherwise; the top bar toggle always works.', }, prefsCard: { title: 'Appearance & Language', diff --git a/frontend/src/i18n/locales/zh/settings.ts b/frontend/src/i18n/locales/zh/settings.ts index 6916a60..b241bce 100644 --- a/frontend/src/i18n/locales/zh/settings.ts +++ b/frontend/src/i18n/locales/zh/settings.ts @@ -137,10 +137,6 @@ export default { dark: '深色', system: '跟随系统', auto: '定时切换', - timezone: '判定时区', - timezoneAria: '主题定时切换时区', - browser: '跟随浏览器(本地)', - autoHint: '按所选时区 {{start}}:00–{{end}}:00 浅色,其余深色;顶栏可随时手动切换。', }, prefsCard: { title: '外观与语言', diff --git a/frontend/src/pages/settings/components/ThemeSection.tsx b/frontend/src/pages/settings/components/ThemeSection.tsx index 4a4e6d0..fe11595 100644 --- a/frontend/src/pages/settings/components/ThemeSection.tsx +++ b/frontend/src/pages/settings/components/ThemeSection.tsx @@ -1,4 +1,4 @@ -import { memo, useMemo } from 'react' +import { memo } from 'react' import { useTranslation } from 'react-i18next' import { useTheme } from 'next-themes' import { Sun, Moon, Monitor, Clock } from 'lucide-react' @@ -7,17 +7,8 @@ import { DAY_START_HOUR, DAY_END_HOUR, setThemeAuto, - setThemeTimezone, - listTimezones, } from '@/lib/theme-schedule' import { useScheduledTheme } from '@/hooks/useScheduledTheme' -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from '@/components/ui/select' type ThemeMode = 'light' | 'dark' | 'system' | 'auto' @@ -36,8 +27,7 @@ const OPTIONS: Array<{ value: ThemeMode; labelKey: string; icon: typeof Sun }> = export const ThemeSection = memo(function ThemeSection() { const { theme, setTheme } = useTheme() const { t } = useTranslation('settings') - const { auto, timezone } = useScheduledTheme() - const timezones = useMemo(() => listTimezones(), []) + const { auto } = useScheduledTheme() const activeValue: ThemeMode = auto ? 'auto' : theme === 'system' ? 'system' : theme === 'dark' ? 'dark' : 'light' const selectTheme = (value: ThemeMode) => { @@ -76,19 +66,6 @@ export const ThemeSection = memo(function ThemeSection() { ) })} - {auto && ( - - )} {auto && (