From 7685bbe74c9000af68395697dafb0617d0eedb43 Mon Sep 17 00:00:00 2001 From: Alexander Lee Date: Wed, 6 Sep 2023 17:08:11 +0800 Subject: [PATCH] Fix/edit nav nits (#1476) * fix: reduce bottom padding of sidebar * fix: text styling * fix: padding on add section button * chore: remove periods from validators * chore: change placeholder text * fix: update default values of new sections * fix: copy changes --- src/layouts/EditNavBar.jsx | 14 +++++++------- src/layouts/components/Editable/Editable.tsx | 1 + src/layouts/components/NavBar/FolderMenuBody.tsx | 2 +- src/layouts/components/NavBar/GroupMenuBody.tsx | 16 +++++++++------- src/layouts/components/NavBar/PageMenuBody.tsx | 4 ++-- src/utils/validators.js | 6 +++--- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/src/layouts/EditNavBar.jsx b/src/layouts/EditNavBar.jsx index efe8186215..b541d9d663 100644 --- a/src/layouts/EditNavBar.jsx +++ b/src/layouts/EditNavBar.jsx @@ -87,28 +87,28 @@ const EditNavBar = ({ match }) => { const errorToast = useErrorToast() const LinkCollectionSectionConstructor = () => ({ - title: "Menu Title", + title: "New folder", collection: collections[0], }) const LinkResourceSectionConstructor = () => ({ - title: "Menu Title", + title: "New resource room", resource_room: true, }) const LinkPageSectionConstructor = () => ({ - title: "Menu Title", + title: "New single page", url: "/permalink", }) const LinkSublinkSectionConstructor = () => ({ - title: "Menu Title", + title: "New menu group", url: "/permalink", sublinks: [], }) const SublinkSectionConstructor = () => ({ - title: "Submenu Title", + title: "New submenu", url: "/permalink", }) @@ -710,7 +710,7 @@ const EditNavBar = ({ match }) => { Menu Group + Menu group } title={link.title} isInvalid={ @@ -763,7 +763,7 @@ const EditNavBar = ({ match }) => { - + {/* NOTE: Check if the site contains any collections in `options` diff --git a/src/layouts/components/Editable/Editable.tsx b/src/layouts/components/Editable/Editable.tsx index 83bb853ed3..3c5cdec529 100644 --- a/src/layouts/components/Editable/Editable.tsx +++ b/src/layouts/components/Editable/Editable.tsx @@ -103,6 +103,7 @@ const EditableSidebar = ({ bg="base.canvas.alt" width="450px" overflowY="scroll" + pb="1.5rem" // NOTE: We reserve 80px **each** for // both the header and the footer h="calc(100vh - 160px - 1rem)" diff --git a/src/layouts/components/NavBar/FolderMenuBody.tsx b/src/layouts/components/NavBar/FolderMenuBody.tsx index 9ea77f3893..cb8755bfd3 100644 --- a/src/layouts/components/NavBar/FolderMenuBody.tsx +++ b/src/layouts/components/NavBar/FolderMenuBody.tsx @@ -50,7 +50,7 @@ export const FolderMenuBody = ({ return ( - Menu Item Name + Menu item name - Menu Group Name + Menu group name Destination {errors.url} - Submenus - - Cards are displayed side by side on a desktop screen + + Submenus + + + Cards are displayed side by side on a desktop screens @@ -87,7 +89,7 @@ export const GroupMenuBody = ({ isRequired isInvalid={!!errors.sublinks[sublinkIndex].title} > - Submenu Name + Submenu name Destination { return ( - Menu Item Name + Menu item name { Destination { switch (linkType) { case "title": if (value.length < LINK_TITLE_MIN_LENGTH) { - errorMessage = `Title cannot be empty.` + errorMessage = `Name cannot be empty` } if (value.length > LINK_TITLE_MAX_LENGTH) { - errorMessage = `Title should be shorter than ${LINK_TITLE_MAX_LENGTH} characters.` + errorMessage = `Name should be shorter than ${LINK_TITLE_MAX_LENGTH} characters` } break case "url": if (value.length < LINK_URL_MIN_LENGTH) { - errorMessage = `Permalink cannot be empty.` + errorMessage = `Destination cannot be empty` } break default: