diff --git a/web/components/pages/editor/editor-body.tsx b/web/components/pages/editor/editor-body.tsx index 395f32ac8..82f21cb71 100644 --- a/web/components/pages/editor/editor-body.tsx +++ b/web/components/pages/editor/editor-body.tsx @@ -104,12 +104,12 @@ export const PageEditorBody: React.FC = observer((props) => {
-
+
= observer((props) => { value={swrPageDetails?.description_html ?? "

"} ref={editorRef} containerClassName="p-0 pb-64" - editorClassName="px-10" + editorClassName="lg:px-10 pl-8" onChange={(_description_json, description_html) => { setIsSubmitting("submitting"); setShowAlert(true); @@ -154,7 +154,7 @@ export const PageEditorBody: React.FC = observer((props) => { initialValue={pageDescription} handleEditorReady={handleReadOnlyEditorReady} containerClassName="p-0 pb-64 border-none" - editorClassName="px-10" + editorClassName="lg:px-10 pl-8" mentionHandler={{ highlights: mentionHighlights, }} @@ -163,7 +163,7 @@ export const PageEditorBody: React.FC = observer((props) => {
; + readOnlyEditorRef: React.RefObject; + handleDuplicatePage: () => void; + isSyncing: boolean; + markings: IMarking[]; + pageStore: IPageStore; + projectId: string; + sidePeekVisible: boolean; + setSidePeekVisible: (sidePeekState: boolean) => void; + editorReady: boolean; + readOnlyEditorReady: boolean; +}; + +export const PageEditorMobileHeaderRoot: React.FC = observer((props) => { + const { + editorRef, + readOnlyEditorRef, + editorReady, + markings, + readOnlyEditorReady, + handleDuplicatePage, + isSyncing, + pageStore, + projectId, + sidePeekVisible, + setSidePeekVisible, + } = props; + // derived values + const { isContentEditable, view_props } = pageStore; + const isFullWidth = !!view_props?.full_width; + + if (!editorRef.current && !readOnlyEditorRef.current) return null; + + return ( + <> +
+
+ +
+ +
+
+ {(editorReady || readOnlyEditorReady) && isContentEditable && editorRef.current && ( + + )} +
+ + ); +}); diff --git a/web/components/pages/editor/header/options-dropdown.tsx b/web/components/pages/editor/header/options-dropdown.tsx index 8158438d1..11be54740 100644 --- a/web/components/pages/editor/header/options-dropdown.tsx +++ b/web/components/pages/editor/header/options-dropdown.tsx @@ -148,7 +148,7 @@ export const PageOptionsDropdown: React.FC = observer((props) => { return ( updateViewProps({ full_width: !view_props?.full_width, diff --git a/web/components/pages/editor/header/root.tsx b/web/components/pages/editor/header/root.tsx index f48921191..83f973f55 100644 --- a/web/components/pages/editor/header/root.tsx +++ b/web/components/pages/editor/header/root.tsx @@ -1,7 +1,7 @@ import { observer } from "mobx-react"; import { EditorReadOnlyRefApi, EditorRefApi, IMarking } from "@plane/document-editor"; // components -import { PageExtraOptions, PageSummaryPopover, PageToolbar } from "@/components/pages"; +import { PageEditorMobileHeaderRoot, PageExtraOptions, PageSummaryPopover, PageToolbar } from "@/components/pages"; // helpers import { cn } from "@/helpers/common.helper"; // store @@ -42,32 +42,49 @@ export const PageEditorHeaderRoot: React.FC = observer((props) => { if (!editorRef.current && !readOnlyEditorRef.current) return null; return ( -
-
- +
+
+ +
+ {(editorReady || readOnlyEditorReady) && isContentEditable && editorRef.current && ( + + )} + +
+
+
- {(editorReady || readOnlyEditorReady) && isContentEditable && editorRef.current && ( - - )} - -
+ ); }); diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index dc244fb69..524384ec8 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -26,7 +26,7 @@ import { NextPageWithLayout } from "@/lib/types"; const PageDetailsPage: NextPageWithLayout = observer(() => { // states - const [sidePeekVisible, setSidePeekVisible] = useState(true); + const [sidePeekVisible, setSidePeekVisible] = useState(window.innerWidth >= 768 ? true : false); const [editorReady, setEditorReady] = useState(false); const [readOnlyEditorReady, setReadOnlyEditorReady] = useState(false); // refs