From a747bafa6919484d3db19bcfa780033b07ba2a2d Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Wed, 2 Aug 2023 13:10:23 +0500 Subject: [PATCH] web: use new editorSidebar --- apps/web/src/components/editor/index.tsx | 157 ++++++++++--------- apps/web/src/components/properties/index.jsx | 52 +++--- 2 files changed, 111 insertions(+), 98 deletions(-) diff --git a/apps/web/src/components/editor/index.tsx b/apps/web/src/components/editor/index.tsx index 0a324d404..c9c734db0 100644 --- a/apps/web/src/components/editor/index.tsx +++ b/apps/web/src/components/editor/index.tsx @@ -205,90 +205,97 @@ export default function EditorManager({ }, [noteId]); return ( - { - Config.set("editor:panesize", sizes[1]); - }} - > - - - {previewSession.current && ( - openSession(noteId)} - /> - )} - - previewSession.current?.content?.data || - editorstore.get().session?.content?.data - } - onPreviewDocument={(url) => setDocPreview(url)} - onContentChange={() => (lastSavedTime.current = Date.now())} - options={{ - readonly: isReadonly || isPreviewSession, - onRequestFocus: () => toggleProperties(false), - onLoadMedia: loadMedia, - focusMode: isFocusMode, - isMobile: isMobile || isTablet + + { + Config.set("editor:panesize", sizes[1]); + }} + > + + - - {arePropertiesVisible && ( - { - previewSession.current = session; - setTimestamp(Date.now()); + > + {previewSession.current && ( + openSession(noteId)} + /> + )} + + previewSession.current?.content?.data || + editorstore.get().session?.content?.data + } + onPreviewDocument={(url) => setDocPreview(url)} + onContentChange={() => (lastSavedTime.current = Date.now())} + options={{ + readonly: isReadonly || isPreviewSession, + onRequestFocus: () => toggleProperties(false), + onLoadMedia: loadMedia, + focusMode: isFocusMode, + isMobile: isMobile || isTablet }} /> - )} - - - - {docPreview && ( - - {docPreview.url ? ( - { + previewSession.current = session; + setTimestamp(Date.now()); + }} + /> + )} + + + + {docPreview && ( + + - } - > - setDocPreview(undefined)} - /> - - - ) : ( - - )} - - )} - + {docPreview.url ? ( + + } + > + setDocPreview(undefined)} + /> + + ) : ( + + )} + + + )} + + ); } @@ -317,7 +324,7 @@ function DownloadAttachmentProgress(props: DownloadAttachmentProgressProps) { return ( - + - - + + ); } export default React.memo(Properties);