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,11 +1,13 @@
import NotificationList from '@/components/NotificationList'
import PrimaryPageLayout from '@/layouts/PrimaryPageLayout'
import { Bell } from 'lucide-react'
import { forwardRef } from 'react'
import { useTranslation } from 'react-i18next'
export default function NotificationListPage() {
const NotificationListPage = forwardRef((_, ref) => {
return (
<PrimaryPageLayout
ref={ref}
pageName="notifications"
titlebar={<NotificationListPageTitlebar />}
displayScrollToTopButton
@ -15,7 +17,9 @@ export default function NotificationListPage() {
</div>
</PrimaryPageLayout>
)
}
})
NotificationListPage.displayName = 'NotificationListPage'
export default NotificationListPage
function NotificationListPageTitlebar() {
const { t } = useTranslation()