feat: 💨
This commit is contained in:
@@ -31,7 +31,7 @@ export default function FeedSwitcher({ close }: { close?: () => void }) {
|
|||||||
<div className="flex justify-between px-2">
|
<div className="flex justify-between px-2">
|
||||||
<div className="text-muted-foreground text-sm font-semibold">{t('relay sets')}</div>
|
<div className="text-muted-foreground text-sm font-semibold">{t('relay sets')}</div>
|
||||||
<SecondaryPageLink
|
<SecondaryPageLink
|
||||||
to={toRelaySettings('relay-sets')}
|
to={toRelaySettings()}
|
||||||
className="text-highlight text-sm font-semibold"
|
className="text-highlight text-sm font-semibold"
|
||||||
onClick={() => close?.()}
|
onClick={() => close?.()}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const toOthersRelaySettings = (pubkey: string) => {
|
|||||||
return `/users/${npub}/relays`
|
return `/users/${npub}/relays`
|
||||||
}
|
}
|
||||||
export const toRelaySettings = (tag?: 'mailbox' | 'relay-sets') => {
|
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 toSettings = () => '/settings'
|
||||||
export const toProfileEditor = () => '/profile-editor'
|
export const toProfileEditor = () => '/profile-editor'
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export default function ProfilePage({ id, index }: { id?: string; index?: number
|
|||||||
<div className="text-muted-foreground">{t('Following')}</div>
|
<div className="text-muted-foreground">{t('Following')}</div>
|
||||||
</SecondaryPageLink>
|
</SecondaryPageLink>
|
||||||
<SecondaryPageLink
|
<SecondaryPageLink
|
||||||
to={isSelf ? toRelaySettings() : toOthersRelaySettings(pubkey)}
|
to={isSelf ? toRelaySettings('mailbox') : toOthersRelaySettings(pubkey)}
|
||||||
className="flex gap-1 hover:underline w-fit"
|
className="flex gap-1 hover:underline w-fit"
|
||||||
>
|
>
|
||||||
{relayCount}
|
{relayCount}
|
||||||
|
|||||||
@@ -7,32 +7,32 @@ import { useTranslation } from 'react-i18next'
|
|||||||
|
|
||||||
export default function RelaySettingsPage({ index }: { index?: number }) {
|
export default function RelaySettingsPage({ index }: { index?: number }) {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const [tabValue, setTabValue] = useState('mailbox')
|
const [tabValue, setTabValue] = useState('relay-sets')
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (window.location.hash === '#relay-sets') {
|
switch (window.location.hash) {
|
||||||
|
case '#mailbox':
|
||||||
|
setTabValue('mailbox')
|
||||||
|
break
|
||||||
|
case '#relay-sets':
|
||||||
setTabValue('relay-sets')
|
setTabValue('relay-sets')
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SecondaryPageLayout index={index} title={t('Relay settings')}>
|
<SecondaryPageLayout index={index} title={t('Relay settings')}>
|
||||||
<Tabs
|
<Tabs value={tabValue} onValueChange={setTabValue} className="px-4 space-y-4">
|
||||||
defaultValue="mailbox"
|
|
||||||
value={tabValue}
|
|
||||||
onValueChange={setTabValue}
|
|
||||||
className="px-4 space-y-4"
|
|
||||||
>
|
|
||||||
<TabsList>
|
<TabsList>
|
||||||
<TabsTrigger value="mailbox">{t('Read & Write Relays')}</TabsTrigger>
|
|
||||||
<TabsTrigger value="relay-sets">{t('Relay Sets')}</TabsTrigger>
|
<TabsTrigger value="relay-sets">{t('Relay Sets')}</TabsTrigger>
|
||||||
|
<TabsTrigger value="mailbox">{t('Read & Write Relays')}</TabsTrigger>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
<TabsContent value="mailbox">
|
|
||||||
<MailboxSetting />
|
|
||||||
</TabsContent>
|
|
||||||
<TabsContent value="relay-sets">
|
<TabsContent value="relay-sets">
|
||||||
<RelaySetsSetting />
|
<RelaySetsSetting />
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
|
<TabsContent value="mailbox">
|
||||||
|
<MailboxSetting />
|
||||||
|
</TabsContent>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</SecondaryPageLayout>
|
</SecondaryPageLayout>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user