diff --git a/components/common/Layout/Layout.tsx b/components/common/Layout/Layout.tsx index 54749c46b..1e1a22967 100644 --- a/components/common/Layout/Layout.tsx +++ b/components/common/Layout/Layout.tsx @@ -8,10 +8,9 @@ import { Navbar, Footer } from '@components/common' import { useAcceptCookies } from '@lib/hooks/useAcceptCookies' import { Sidebar, Button, Modal, LoadingDots } from '@components/ui' import CartSidebarView from '@components/cart/CartSidebarView' - +import type { Page, Category } from '@commerce/types' import LoginView from '@components/auth/LoginView' import { CommerceProvider } from '@framework' -import type { Page } from '@framework/common/get-all-pages' const Loading = () => (
@@ -41,13 +40,13 @@ const FeatureBar = dynamic( interface Props { pageProps: { pages?: Page[] - commerceFeatures: Record + categories: Category[] } } const Layout: FC = ({ children, - pageProps: { commerceFeatures, ...pageProps }, + pageProps: { categories = [], ...pageProps }, }) => { const { displaySidebar, @@ -58,10 +57,16 @@ const Layout: FC = ({ } = useUI() const { acceptedCookies, onAcceptCookies } = useAcceptCookies() const { locale = 'en-US' } = useRouter() + + const navBarlinks = categories.slice(0, 2).map((c) => ({ + label: c.name, + href: `/search/${c.slug}`, + })) + return (
- +
{children}