From 042ed04a0359913674d6eb612bcb43fce0dfeda1 Mon Sep 17 00:00:00 2001 From: Lakhan Baheti <94619783+1akhanBaheti@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:01:58 +0530 Subject: [PATCH] fix: project-pages responsiveness (#3624) * fix: pages responsiveness * fix: build errors --- .../src/ui/components/editor-header.tsx | 6 +-- .../src/ui/components/page-renderer.tsx | 2 +- .../src/ui/components/summary-popover.tsx | 34 ++++++++++----- .../editor/document-editor/src/ui/index.tsx | 8 +++- .../src/ui/menu/fixed-menu.tsx | 2 +- .../sidebar/sidebar-menu-hamburger-toggle.tsx | 2 +- web/components/empty-state/empty-state.tsx | 8 ++-- web/components/headers/page-details.tsx | 41 ++++++++++++------- .../pages/create-update-page-modal.tsx | 2 +- web/components/pages/page-form.tsx | 4 +- web/components/pages/pages-list/list-item.tsx | 2 +- .../pages/pages-list/recent-pages-list.tsx | 2 +- .../projects/[projectId]/pages/index.tsx | 26 ++++++++++-- 13 files changed, 94 insertions(+), 45 deletions(-) diff --git a/packages/editor/document-editor/src/ui/components/editor-header.tsx b/packages/editor/document-editor/src/ui/components/editor-header.tsx index 3501785a7..a322ddddc 100644 --- a/packages/editor/document-editor/src/ui/components/editor-header.tsx +++ b/packages/editor/document-editor/src/ui/components/editor-header.tsx @@ -42,8 +42,8 @@ export const EditorHeader = (props: IEditorHeader) => { } = props; return ( -
-
+
+
{ />
-
+
{!readonly && uploadFile && ( )} diff --git a/packages/editor/document-editor/src/ui/components/page-renderer.tsx b/packages/editor/document-editor/src/ui/components/page-renderer.tsx index c60ac0e7a..06b9e70ff 100644 --- a/packages/editor/document-editor/src/ui/components/page-renderer.tsx +++ b/packages/editor/document-editor/src/ui/components/page-renderer.tsx @@ -152,7 +152,7 @@ export const PageRenderer = (props: IPageRenderer) => { ); return ( -
+
{!readonly ? ( handlePageTitleChange(e.target.value)} diff --git a/packages/editor/document-editor/src/ui/components/summary-popover.tsx b/packages/editor/document-editor/src/ui/components/summary-popover.tsx index d3ec64f1c..12903bb3d 100644 --- a/packages/editor/document-editor/src/ui/components/summary-popover.tsx +++ b/packages/editor/document-editor/src/ui/components/summary-popover.tsx @@ -40,16 +40,30 @@ export const SummaryPopover: React.FC = (props) => { > - {!sidePeekVisible && ( -
- -
- )} +
+ {sidePeekVisible && ( +
+ +
+ )} +
+
+ {!sidePeekVisible && ( +
+ +
+ )} +
); }; diff --git a/packages/editor/document-editor/src/ui/index.tsx b/packages/editor/document-editor/src/ui/index.tsx index d1bdbc935..2491e04c7 100644 --- a/packages/editor/document-editor/src/ui/index.tsx +++ b/packages/editor/document-editor/src/ui/index.tsx @@ -10,6 +10,7 @@ import { DocumentDetails } from "src/types/editor-types"; import { PageRenderer } from "src/ui/components/page-renderer"; import { getMenuOptions } from "src/utils/menu-options"; import { useRouter } from "next/router"; +import { FixedMenu } from "src"; interface IDocumentEditor { // document info @@ -149,11 +150,14 @@ const DocumentEditor = ({ documentDetails={documentDetails} isSubmitting={isSubmitting} /> +
+ {uploadFile && } +
-
+
-
+
{ } return ( -
+
{basicMarkItems.map((item) => ( diff --git a/web/components/pages/pages-list/list-item.tsx b/web/components/pages/pages-list/list-item.tsx index 03133d5df..6b1a4793d 100644 --- a/web/components/pages/pages-list/list-item.tsx +++ b/web/components/pages/pages-list/list-item.tsx @@ -155,7 +155,7 @@ export const PagesListItem: FC = observer(({ pageId, projectId } setDeletePageModal(false)} pageId={pageId} />
  • -
    +
    diff --git a/web/components/pages/pages-list/recent-pages-list.tsx b/web/components/pages/pages-list/recent-pages-list.tsx index 960d5253b..e998629c6 100644 --- a/web/components/pages/pages-list/recent-pages-list.tsx +++ b/web/components/pages/pages-list/recent-pages-list.tsx @@ -52,7 +52,7 @@ export const RecentPagesList: FC = observer(() => { return (
    -

    +

    {replaceUnderscoreIfSnakeCase(key)}

    diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx index 10cda05e1..b935ee238 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx @@ -102,6 +102,25 @@ const ProjectPagesPage: NextPageWithLayout = observer(() => { const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserWorkspaceRoles.MEMBER; + const mobileTabList = ( + +
    + {PAGE_TABS_LIST.map((tab) => ( + + `text-sm outline-none pb-3 ${ + selected ? "border-custom-primary-100 text-custom-primary-100 border-b" : "" + }` + } + > + {tab.title} + + ))} +
    +
    + ); + if (loader || archivedPageLoader) return (
    @@ -120,8 +139,8 @@ const ProjectPagesPage: NextPageWithLayout = observer(() => { projectId={projectId.toString()} /> )} -
    -
    +
    +

    Pages

    { } }} > - +
    {mobileTabList}
    +
    {PAGE_TABS_LIST.map((tab) => (