From 9cc99ebb8e380f9b5e855b6d3250dfe96e237134 Mon Sep 17 00:00:00 2001 From: kunish Date: Fri, 22 Sep 2023 15:07:13 +0800 Subject: [PATCH] feat(config): move switch language button into header --- src/components/Collapse.tsx | 2 +- src/components/Header.tsx | 18 +++++++++++++++--- src/pages/Config.tsx | 16 ++-------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/Collapse.tsx b/src/components/Collapse.tsx index 87e46fc..f9cc798 100644 --- a/src/components/Collapse.tsx +++ b/src/components/Collapse.tsx @@ -28,7 +28,7 @@ export const Collapse: ParentComponent = (props) => {
= ({ @@ -61,7 +62,7 @@ const ThemeSwitcher = () => ( ) export const Header = () => { - const [t] = useI18n() + const [t, { locale }] = useI18n() const navs = () => [ { href: ROUTES.Overview, @@ -151,6 +152,17 @@ export const Header = () => { diff --git a/src/pages/Config.tsx b/src/pages/Config.tsx index 0948b3b..d800940 100644 --- a/src/pages/Config.tsx +++ b/src/pages/Config.tsx @@ -27,7 +27,7 @@ import { upgradingBackend, } from '~/apis' import { Button, ConfigTitle } from '~/components' -import { LANG, MODE_OPTIONS, ROUTES, themes } from '~/constants' +import { MODE_OPTIONS, ROUTES, themes } from '~/constants' import { autoSwitchTheme, favDayTheme, @@ -269,22 +269,10 @@ const ConfigForm = () => { } const ConfigForXd = () => { - const [t, { locale }] = useI18n() + const [t] = useI18n() return (
-
- -
-
{t('autoSwitchTheme')}