Sfoglia il codice sorgente

Merge branch 'feat/article-area-renovation' into display-expected-page-selected-buttons

zahmis 5 anni fa
parent
commit
9de0c64c41
1 ha cambiato i file con 8 aggiunte e 9 eliminazioni
  1. 8 9
      src/client/js/components/Page/DisplaySwitcher.jsx

+ 8 - 9
src/client/js/components/Page/DisplaySwitcher.jsx

@@ -10,22 +10,21 @@ import EditorNavbarBottom from '../PageEditor/EditorNavbarBottom';
 
 
 const DisplaySwitcher = (props) => {
-  const { navigationContainer /* , pageContainer  */ } = props;
-  // const { page } = pageContainer;
+  const { navigationContainer /* ,pageContainer */ } = props;
+  const { editorMode } = navigationContainer.state;
 
   return (
-    <div>
-      {navigationContainer.state.editorMode === 'view' && <Page /* page={page} */ />}
-      {navigationContainer.state.editorMode === 'edit' && (
+    <>
+      {editorMode === 'view' && <Page />}
+      {editorMode === 'edit' && (
         <>
           <Editor />
           <EditorNavbarBottom />
         </>
-        )}
-      {navigationContainer.state.editorMode === 'hackmd' && <PageEditorByHackmd />}
-    </div>
+      )}
+      {editorMode === 'hackmd' && <PageEditorByHackmd />}
+    </>
   );
-
 };
 
 DisplaySwitcher.propTypes = {