From 0036ac6afb343ea9c097ff77abb2449c66759d95 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Tue, 4 Apr 2023 18:31:28 +0530 Subject: [PATCH] fix: minor pages ui (#700) --- .../pages/create-update-block-inline.tsx | 6 ++-- .../pages/single-page-detailed-item.tsx | 33 ++++++------------- .../projects/[projectId]/pages/[pageId].tsx | 4 +-- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/apps/app/components/pages/create-update-block-inline.tsx b/apps/app/components/pages/create-update-block-inline.tsx index dbbe54696..b5f36722f 100644 --- a/apps/app/components/pages/create-update-block-inline.tsx +++ b/apps/app/components/pages/create-update-block-inline.tsx @@ -148,15 +148,15 @@ export const CreateUpdateBlockInline: React.FC = ({ useEffect(() => { window.addEventListener("keydown", (e: KeyboardEvent) => { - if (e.key === "Escape") onClose(); + if (e.key === "Escape") handleClose(); }); return () => { window.removeEventListener("keydown", (e: KeyboardEvent) => { - if (e.key === "Escape") onClose(); + if (e.key === "Escape") handleClose(); }); }; - }, [onClose]); + }, [handleClose]); return (
diff --git a/apps/app/components/pages/single-page-detailed-item.tsx b/apps/app/components/pages/single-page-detailed-item.tsx index b07b87f89..e53a1c78b 100644 --- a/apps/app/components/pages/single-page-detailed-item.tsx +++ b/apps/app/components/pages/single-page-detailed-item.tsx @@ -50,9 +50,9 @@ export const SinglePageDetailedItem: React.FC = ({ const { workspaceSlug, projectId } = router.query; return ( - - -
+
+ +

{truncateText(page.name, 75)}

@@ -157,26 +157,13 @@ export const SinglePageDetailedItem: React.FC = ({
-
-
- {page.blocks.length > 0 ? ( - - ) : null} -
+
+ {page.blocks.length > 0 + ? page.blocks.slice(0, 3).map((block) =>

{block.name}

) + : null}
-
-
- + + +
); }; diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index 29cdede37..c840b40d1 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -477,7 +477,7 @@ const SinglePage: NextPage = (props) => { {!createBlockForm && ( )} {createBlockForm && ( -
+
setCreateBlockForm(false)} focus="name"