refactor: page manager

This commit is contained in:
codytseng 2025-11-03 17:41:01 +08:00
parent 1b7ec56c89
commit 579385ce3d
13 changed files with 131 additions and 121 deletions

View file

@ -2,24 +2,19 @@ import BookmarkList from '@/components/BookmarkList'
import PrimaryPageLayout from '@/layouts/PrimaryPageLayout'
import { TPageRef } from '@/types'
import { BookmarkIcon } from 'lucide-react'
import { forwardRef, useImperativeHandle, useRef } from 'react'
import { forwardRef } from 'react'
import { useTranslation } from 'react-i18next'
const BookmarkPage = forwardRef((_, ref) => {
const layoutRef = useRef<TPageRef>(null)
useImperativeHandle(ref, () => layoutRef.current)
return (
<PrimaryPageLayout
pageName="bookmark"
ref={layoutRef}
titlebar={<BookmarkPageTitlebar />}
displayScrollToTopButton
>
<BookmarkList />
</PrimaryPageLayout>
)
})
const BookmarkPage = forwardRef<TPageRef>((_, ref) => (
<PrimaryPageLayout
pageName="bookmark"
ref={ref}
titlebar={<BookmarkPageTitlebar />}
displayScrollToTopButton
>
<BookmarkList />
</PrimaryPageLayout>
))
BookmarkPage.displayName = 'BookmarkPage'
export default BookmarkPage