mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
chore: migrate page method to hooks
This commit is contained in:
@@ -28,15 +28,11 @@ import { useRouter } from 'next/router';
|
||||
import { useConfirm } from '@/providers/confirm-provider';
|
||||
import { SyncIcon } from './sync-icon';
|
||||
import { toast } from '@/components/toast';
|
||||
|
||||
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
||||
import { usePageHelper } from '@/hooks/use-page-helper';
|
||||
const PopoverContent = () => {
|
||||
const {
|
||||
getPageMeta,
|
||||
editor,
|
||||
currentPage,
|
||||
toggleFavoritePage,
|
||||
toggleDeletePage,
|
||||
} = useAppState();
|
||||
const { getPageMeta, editor, currentPage } = useAppState();
|
||||
const { toggleFavoritePage, toggleDeletePage } = usePageHelper();
|
||||
const { mode, setMode } = useEditor();
|
||||
const { confirm } = useConfirm();
|
||||
|
||||
@@ -192,7 +188,8 @@ const HeaderRight = () => {
|
||||
|
||||
export const Header = ({ children }: PropsWithChildren<{}>) => {
|
||||
const [showWarning, setShowWarning] = useState(shouldShowWarning());
|
||||
|
||||
const currentPageMeta = useCurrentPageMeta();
|
||||
console.log('currentPageMeta', currentPageMeta);
|
||||
return (
|
||||
<StyledHeaderContainer hasWarning={showWarning}>
|
||||
<BrowserWarning
|
||||
|
||||
Reference in New Issue
Block a user