feat(core): add outline viewer for share page (#8190)

This commit is contained in:
L-Sun
2024-09-10 14:00:16 +00:00
parent daa9d9ff5c
commit 6ce6cb33ef
3 changed files with 63 additions and 3 deletions
@@ -11,7 +11,7 @@ export const EditorOutlineViewer = ({
}: {
editor: AffineEditorContainer | null;
show: boolean;
openOutlinePanel: () => void;
openOutlinePanel?: () => void;
}) => {
const outlineViewerRef = useRef<OutlineViewer | null>(null);
@@ -34,7 +34,10 @@ export const EditorOutlineViewer = ({
if (outlineViewerRef.current.editor !== editor) {
outlineViewerRef.current.editor = editor;
}
if (outlineViewerRef.current.toggleOutlinePanel !== openOutlinePanel) {
if (
outlineViewerRef.current.toggleOutlinePanel !== openOutlinePanel &&
openOutlinePanel
) {
outlineViewerRef.current.toggleOutlinePanel = openOutlinePanel;
}