From 35a22bd2bac24829aa6adaa218202df279eabf99 Mon Sep 17 00:00:00 2001 From: codytseng Date: Mon, 13 Jan 2025 18:07:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/secondary/SettingsPage/index.tsx | 47 ++++++++++++---------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/pages/secondary/SettingsPage/index.tsx b/src/pages/secondary/SettingsPage/index.tsx index 9f2072ad..e49aa1fc 100644 --- a/src/pages/secondary/SettingsPage/index.tsx +++ b/src/pages/secondary/SettingsPage/index.tsx @@ -8,7 +8,7 @@ import { useTheme } from '@/providers/ThemeProvider' import { TLanguage } from '@/types' import { SelectValue } from '@radix-ui/react-select' import { ChevronRight, Info, Languages, Server, SunMoon } from 'lucide-react' -import { HTMLProps, useState } from 'react' +import { forwardRef, HTMLProps, useState } from 'react' import { useTranslation } from 'react-i18next' export default function SettingsPage({ index }: { index?: number }) { @@ -24,7 +24,7 @@ export default function SettingsPage({ index }: { index?: number }) { return ( - +
{t('Languages')}
@@ -38,8 +38,8 @@ export default function SettingsPage({ index }: { index?: number }) { 简体中文 - - + +
{t('Theme')}
@@ -54,16 +54,16 @@ export default function SettingsPage({ index }: { index?: number }) { {t('Dark')} - - push(toRelaySettings())}> + + push(toRelaySettings())}>
{t('Relays')}
-
+ - +
{t('About')}
@@ -74,22 +74,25 @@ export default function SettingsPage({ index }: { index?: number }) {
-
+ ) } -function Item({ children, className, ...props }: HTMLProps) { - return ( -
- {children} -
- ) -} +const SettingItem = forwardRef>( + ({ children, className, ...props }) => { + return ( +
+ {children} +
+ ) + } +) +SettingItem.displayName = 'SettingItem'