chore: remove useEditor

This commit is contained in:
QiShaoXuan
2022-12-20 19:30:38 +08:00
parent dacdb4f7d4
commit 2ede288724
28 changed files with 303 additions and 141 deletions
@@ -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 && (