From 1644a9261561cdb327571960dbc6473dc4ab3e63 Mon Sep 17 00:00:00 2001 From: codytseng Date: Sat, 18 Jan 2025 14:22:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=92=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FeedSwitcher/index.tsx | 2 +- src/lib/link.ts | 2 +- src/pages/secondary/ProfilePage/index.tsx | 2 +- .../secondary/RelaySettingsPage/index.tsx | 26 +++++++++---------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/FeedSwitcher/index.tsx b/src/components/FeedSwitcher/index.tsx index 3539e61f..dbd4842f 100644 --- a/src/components/FeedSwitcher/index.tsx +++ b/src/components/FeedSwitcher/index.tsx @@ -31,7 +31,7 @@ export default function FeedSwitcher({ close }: { close?: () => void }) {
{t('relay sets')}
close?.()} > diff --git a/src/lib/link.ts b/src/lib/link.ts index c3fcc80a..130710b7 100644 --- a/src/lib/link.ts +++ b/src/lib/link.ts @@ -33,7 +33,7 @@ export const toOthersRelaySettings = (pubkey: string) => { return `/users/${npub}/relays` } export const toRelaySettings = (tag?: 'mailbox' | 'relay-sets') => { - return '/relay-settings' + (tag === 'relay-sets' ? '#relay-sets' : '') + return '/relay-settings' + (tag ? '#' + tag : '') } export const toSettings = () => '/settings' export const toProfileEditor = () => '/profile-editor' diff --git a/src/pages/secondary/ProfilePage/index.tsx b/src/pages/secondary/ProfilePage/index.tsx index 4f09a934..a91f1915 100644 --- a/src/pages/secondary/ProfilePage/index.tsx +++ b/src/pages/secondary/ProfilePage/index.tsx @@ -125,7 +125,7 @@ export default function ProfilePage({ id, index }: { id?: string; index?: number
{t('Following')}
{relayCount} diff --git a/src/pages/secondary/RelaySettingsPage/index.tsx b/src/pages/secondary/RelaySettingsPage/index.tsx index b39be0c2..2f7a3413 100644 --- a/src/pages/secondary/RelaySettingsPage/index.tsx +++ b/src/pages/secondary/RelaySettingsPage/index.tsx @@ -7,32 +7,32 @@ import { useTranslation } from 'react-i18next' export default function RelaySettingsPage({ index }: { index?: number }) { const { t } = useTranslation() - const [tabValue, setTabValue] = useState('mailbox') + const [tabValue, setTabValue] = useState('relay-sets') useEffect(() => { - if (window.location.hash === '#relay-sets') { - setTabValue('relay-sets') + switch (window.location.hash) { + case '#mailbox': + setTabValue('mailbox') + break + case '#relay-sets': + setTabValue('relay-sets') + break } }, []) return ( - + - {t('Read & Write Relays')} {t('Relay Sets')} + {t('Read & Write Relays')} - - - + + + )