opti: 1.adjust eventlistener;

This commit is contained in:
mitsuha
2022-08-24 10:40:14 +08:00
parent c4de1a6061
commit f2a21e6c3b
3 changed files with 4 additions and 4 deletions
@@ -23,7 +23,7 @@ import { useFlag } from '@toeverything/datasource/feature-flags';
import { CollapsiblePageTree } from './collapsible-page-tree';
import { Tabs } from './components/tabs';
import { TabMap, TAB_TITLE } from './components/tabs/Tabs';
import { Toc } from './components/toc';
import { TOC } from './components/toc';
import { WorkspaceName } from './workspace-name';
type PageProps = {
@@ -92,7 +92,7 @@ export function Page(props: PageProps) {
)}
{activeTab === TabMap.get(TAB_TITLE.TOC).value && (
<Toc editor={editorRef.current}>TOC</Toc>
<TOC editor={editorRef.current}>TOC</TOC>
)}
</WorkspaceSidebarContent>
</WorkspaceSidebar>
@@ -119,7 +119,7 @@ const renderTOCContent = tocDataSource => {
);
};
export const Toc = (props: Props) => {
export const TOC = (props: Props) => {
const { editor } = props;
const { page_id } = useParams();
const [tocDataSource, setTocDataSource] = useState<TocType[]>([]);
@@ -1 +1 @@
export { Toc } from './Toc';
export { TOC } from './TOC';