diff --git a/app/layout.tsx b/app/layout.tsx index c4c4f9773..4c199666e 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,12 +1,6 @@ -import { CartProvider } from 'components/cart/cart-context'; -import { Navbar } from 'components/layout/navbar'; -import { WelcomeToast } from 'components/welcome-toast'; import { GeistSans } from 'geist/font/sans'; -import { getCart } from 'lib/fourthwall'; import { ensureStartsWith } from 'lib/utils'; -import { cookies } from 'next/headers'; import { ReactNode } from 'react'; -import { Toaster } from 'sonner'; import './globals.css'; const { TWITTER_CREATOR, TWITTER_SITE, SITE_NAME } = process.env; @@ -37,21 +31,11 @@ export const metadata = { }; export default async function RootLayout({ children }: { children: ReactNode }) { - const cartId = cookies().get('cartId')?.value; - // Don't await the fetch, pass the Promise to the context provider - const cart = getCart(cartId, 'USD'); return ( - - -
- {children} - - -
-
+ {children} ); diff --git a/app/page.tsx b/app/page.tsx index af275eab5..3e12b7af3 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,6 +1,9 @@ import { Carousel } from 'components/carousel'; import { ThreeItemGrid } from 'components/grid/three-items'; import Footer from 'components/layout/footer'; +import { Wrapper } from 'components/wrapper'; +import { getCart } from 'lib/fourthwall'; +import { cookies } from 'next/headers'; export const metadata = { description: 'High-performance ecommerce store built with Next.js, Vercel, and Shopify.', @@ -9,14 +12,17 @@ export const metadata = { } }; -export default function HomePage({ searchParams }: { searchParams: { currency?: string } }) { +export default async function HomePage({ searchParams }: { searchParams: { currency?: string } }) { + const cartId = cookies().get('cartId')?.value; const currency = searchParams.currency || 'USD'; + // Don't await the fetch, pass the Promise to the context provider + const cart = getCart(cartId, currency); return ( - <> + - +