diff --git a/apps/studio/src/components/CmsSidebar/CmsContainer.tsx b/apps/studio/src/components/CmsSidebar/CmsContainer.tsx index fb8041f800..93fbf9fa2b 100644 --- a/apps/studio/src/components/CmsSidebar/CmsContainer.tsx +++ b/apps/studio/src/components/CmsSidebar/CmsContainer.tsx @@ -75,7 +75,7 @@ export function CmsContainer({ {sidenav} - + ({ const styles = useMultiStyleConfig("Table", tableProps) return ( - + {isFetching && ( <> { return ( { + const allBreadcrumbsExceptLast = breadcrumbs.slice(0, -1) + const lastBreadcrumb = breadcrumbs[breadcrumbs.length - 1] + return ( + + + + {allBreadcrumbsExceptLast.map(({ href, label }, index) => { + return ( + + + + {label} + + + + ) + })} + + + {lastBreadcrumb?.label} + + + + + + + {icon} + + + {title} + + + {buttons} + + + {children} + + ) +} diff --git a/apps/studio/src/pages/sites/[siteId]/collections/[resourceId].tsx b/apps/studio/src/pages/sites/[siteId]/collections/[resourceId].tsx index 5995537de7..aa22afa6d3 100644 --- a/apps/studio/src/pages/sites/[siteId]/collections/[resourceId].tsx +++ b/apps/studio/src/pages/sites/[siteId]/collections/[resourceId].tsx @@ -1,14 +1,5 @@ -import NextLink from "next/link" -import { - Box, - BreadcrumbItem, - BreadcrumbLink, - HStack, - Stack, - Text, - useDisclosure, -} from "@chakra-ui/react" -import { Breadcrumb, Button } from "@opengovsg/design-system-react" +import { useDisclosure } from "@chakra-ui/react" +import { Button } from "@opengovsg/design-system-react" import { useSetAtom } from "jotai" import { BiData } from "react-icons/bi" import { z } from "zod" @@ -17,6 +8,7 @@ import { PermissionsBoundary } from "~/components/AuthWrappers" import { folderSettingsModalAtom } from "~/features/dashboard/atoms" import { CollectionBanner } from "~/features/dashboard/components/CollectionBanner" import { CollectionTable } from "~/features/dashboard/components/CollectionTable" +import { DashboardLayout } from "~/features/dashboard/components/DashboardLayout" import { DeleteResourceModal } from "~/features/dashboard/components/DeleteResourceModal/DeleteResourceModal" import { FolderSettingsModal } from "~/features/dashboard/components/FolderSettingsModal" import { PageSettingsModal } from "~/features/dashboard/components/PageSettingsModal" @@ -49,38 +41,21 @@ const CollectionResourceListPage: NextPageWithLayout = () => { return ( <> - - - - - - Home - - - - - - - {metadata.title} - - - - - - - - - - - {metadata.title} - - - + } + title={metadata.title} + buttons={ + <> - - + + } + > - - - - + + { return ( <> - - - - {breadcrumbs.map(({ href, label }, index) => { - return ( - - - - {label} - - - - ) - })} - } + title={title} + buttons={ + <> + - - {({ isOpen }) => ( - <> - - Create new... - - - - } - > - Folder - - } - > - Page - - - - - )} - - - - - - - - - - - + Folder settings + + + {({ isOpen }) => ( + <> + + Create new... + + + + } + > + Folder + + } + > + Page + + + + + )} + + + } + > + + { return ( <> - } + title="Home" + buttons={ + + } > - - - - - Home - - - - - - - - - - Home - - - - - - - - - + +