Просмотр исходного кода

Merge pull request #8604 from weseek/fix/143061-page-editor-read-only

fix: Visibility of PageViewReadOnly
Yuki Takei 2 лет назад
Родитель
Сommit
e31a5bae04
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      apps/app/src/components/PageEditor/PageEditorReadOnly.tsx

+ 6 - 2
apps/app/src/components/PageEditor/PageEditorReadOnly.tsx

@@ -11,7 +11,11 @@ import { EditorNavbar } from './EditorNavbar';
 import Preview from './Preview';
 import Preview from './Preview';
 import { useScrollSync } from './ScrollSyncHelper';
 import { useScrollSync } from './ScrollSyncHelper';
 
 
-export const PageEditorReadOnly = react.memo((): JSX.Element => {
+type Props = {
+  visibility?: boolean,
+}
+
+export const PageEditorReadOnly = react.memo(({ visibility }: Props): JSX.Element => {
   const previewRef = useRef<HTMLDivElement>(null);
   const previewRef = useRef<HTMLDivElement>(null);
 
 
   const { data: currentPage } = useSWRxCurrentPage();
   const { data: currentPage } = useSWRxCurrentPage();
@@ -30,7 +34,7 @@ export const PageEditorReadOnly = react.memo((): JSX.Element => {
   }
   }
 
 
   return (
   return (
-    <div id="page-editor" className="flex-expand-vert">
+    <div id="page-editor" className={`flex-expand-vert ${visibility ? '' : 'd-none'}`}>
       <EditorNavbar />
       <EditorNavbar />
 
 
       <div className="flex-expand-horiz">
       <div className="flex-expand-horiz">