feat: scroll to top when jumping to the current page

This commit is contained in:
codytseng 2025-01-26 16:28:47 +08:00
parent 82537f192b
commit 23bf7fd005
23 changed files with 235 additions and 132 deletions

View file

@ -1,9 +1,10 @@
import OthersRelayList from '@/components/OthersRelayList'
import { useFetchProfile } from '@/hooks'
import SecondaryPageLayout from '@/layouts/SecondaryPageLayout'
import { forwardRef } from 'react'
import { useTranslation } from 'react-i18next'
export default function RelaySettingsPage({ id, index }: { id?: string; index?: number }) {
const RelaySettingsPage = forwardRef(({ id, index }: { id?: string; index?: number }, ref) => {
const { t } = useTranslation()
const { profile } = useFetchProfile(id)
@ -13,6 +14,7 @@ export default function RelaySettingsPage({ id, index }: { id?: string; index?:
return (
<SecondaryPageLayout
ref={ref}
index={index}
title={t("username's used relays", { username: profile.username })}
>
@ -21,4 +23,6 @@ export default function RelaySettingsPage({ id, index }: { id?: string; index?:
</div>
</SecondaryPageLayout>
)
}
})
RelaySettingsPage.displayName = 'RelaySettingsPage'
export default RelaySettingsPage