Implementing FeaturesAPI with Wishlist

This commit is contained in:
okbel
2021-02-18 13:21:43 -03:00
parent 4cfa0418dd
commit cbc354e0b6
4 changed files with 15 additions and 12 deletions

View File

@@ -44,7 +44,11 @@ interface Props {
}
}
const Layout: FC<Props> = ({ children, pageProps }) => {
const Layout: FC<Props> = ({
children,
pageProps: { commerceFeatures, ...pageProps },
}) => {
console.log(pageProps)
const {
displaySidebar,
displayModal,
@@ -54,11 +58,11 @@ const Layout: FC<Props> = ({ children, pageProps }) => {
} = useUI()
const { acceptedCookies, onAcceptCookies } = useAcceptCookies()
const { locale = 'en-US' } = useRouter()
const isWishlistEnabled = commerceFeatures.wishlist
return (
<CommerceProvider locale={locale}>
<div className={cn(s.root)}>
<Navbar />
<Navbar wishlist={isWishlistEnabled} />
<main className="fit">{children}</main>
<Footer pages={pageProps.pages} />
@@ -69,7 +73,7 @@ const Layout: FC<Props> = ({ children, pageProps }) => {
</Modal>
<Sidebar open={displaySidebar} onClose={closeSidebar}>
<CartSidebarView />
<CartSidebarView wishlist={isWishlistEnabled} />
</Sidebar>
<FeatureBar