mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 18:16:15 +08:00
chore: remove useEditor
This commit is contained in:
@@ -6,18 +6,19 @@ import {
|
||||
StyledTitleWrapper,
|
||||
} from './styles';
|
||||
import { Content } from '@/ui/layout';
|
||||
import { useEditor } from '@/providers/editor-provider';
|
||||
import { useAppState } from '@/providers/app-state-provider/context';
|
||||
import EditorModeSwitch from '@/components/editor-mode-switch';
|
||||
import QuickSearchButton from './quick-search-button';
|
||||
import Header from './header';
|
||||
import usePropsUpdated from '@/hooks/use-props-updated';
|
||||
import useCurrentPageMeta from '@/hooks/use-current-page-meta';
|
||||
|
||||
export const EditorHeader = () => {
|
||||
const [title, setTitle] = useState('');
|
||||
const [isHover, setIsHover] = useState(false);
|
||||
const { getPageMeta, currentPage, editor } = useAppState();
|
||||
|
||||
const { onPropsUpdated } = useEditor();
|
||||
const { editor } = useAppState();
|
||||
const pageMeta = useCurrentPageMeta();
|
||||
const onPropsUpdated = usePropsUpdated();
|
||||
|
||||
useEffect(() => {
|
||||
onPropsUpdated(editor => {
|
||||
@@ -32,8 +33,6 @@ export const EditorHeader = () => {
|
||||
}, 300);
|
||||
}, [editor]);
|
||||
|
||||
const pageMeta = currentPage?.pageId ? getPageMeta(currentPage.pageId) : null;
|
||||
|
||||
return (
|
||||
<Header>
|
||||
{title && (
|
||||
|
||||
Reference in New Issue
Block a user