mirror of
https://github.com/vercel/commerce.git
synced 2025-07-30 13:41:22 +00:00
Merge branch 'master' of https://github.com/okbel/e-comm-example
This commit is contained in:
4
components/core/Layout/Layout.module.css
Normal file
4
components/core/Layout/Layout.module.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.root {
|
||||
@apply h-full bg-primary mx-auto;
|
||||
max-width: 2460px;
|
||||
}
|
@@ -1,10 +1,13 @@
|
||||
import { FC } from 'react'
|
||||
import cn from 'classnames'
|
||||
import type { Page } from '@lib/bigcommerce/api/operations/get-all-pages'
|
||||
import { CommerceProvider } from '@lib/bigcommerce'
|
||||
import { Navbar, Featurebar, Footer } from '@components/core'
|
||||
import { Container, Sidebar } from '@components/ui'
|
||||
import { CartSidebarView } from '@components/cart'
|
||||
import { UIProvider, useUI } from '@components/ui/context'
|
||||
import s from './Layout.module.css'
|
||||
import { ThemeProvider } from 'next-themes'
|
||||
import { SSRProvider, OverlayProvider } from 'react-aria'
|
||||
|
||||
interface LayoutProps {
|
||||
pageProps: {
|
||||
@@ -13,7 +16,6 @@ interface LayoutProps {
|
||||
}
|
||||
|
||||
interface Props {
|
||||
children?: any
|
||||
pages?: Page[]
|
||||
}
|
||||
|
||||
@@ -21,7 +23,7 @@ const CoreLayout: FC<Props> = ({ children, pages }) => {
|
||||
const { displaySidebar, closeSidebar } = useUI()
|
||||
|
||||
return (
|
||||
<div className="h-full bg-primary">
|
||||
<div className={cn(s.root)}>
|
||||
<Featurebar
|
||||
title="Free Standard Shipping on orders over $99.99"
|
||||
description="Due to COVID-19, some orders may experience processing and delivery delays."
|
||||
@@ -39,11 +41,15 @@ const CoreLayout: FC<Props> = ({ children, pages }) => {
|
||||
}
|
||||
|
||||
const Layout: FC<LayoutProps> = ({ children, pageProps }) => (
|
||||
<CommerceProvider locale="en-us">
|
||||
<UIProvider>
|
||||
<CoreLayout pages={pageProps.pages}>{children}</CoreLayout>
|
||||
</UIProvider>
|
||||
</CommerceProvider>
|
||||
<UIProvider>
|
||||
<ThemeProvider>
|
||||
<SSRProvider>
|
||||
<OverlayProvider>
|
||||
<CoreLayout pages={pageProps.pages}>{children}</CoreLayout>
|
||||
</OverlayProvider>
|
||||
</SSRProvider>
|
||||
</ThemeProvider>
|
||||
</UIProvider>
|
||||
)
|
||||
|
||||
export default Layout
|
||||
|
Reference in New Issue
Block a user