Skip to content

Commit dbed9b9

Browse files
committed
fix: layouts
1 parent 961f12d commit dbed9b9

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

src/app/checkout/layout.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"use client"
2+
3+
import { MEDUSA_BACKEND_URL, queryClient } from "@lib/config"
4+
import { AccountProvider } from "@lib/context/account-context"
5+
import { StoreProvider } from "@lib/context/store-context"
6+
import { CartProvider, MedusaProvider } from "medusa-react"
7+
import "styles/globals.css"
8+
9+
export default function CheckoutLayout({
10+
children,
11+
}: {
12+
children: React.ReactNode
13+
}) {
14+
return (
15+
<MedusaProvider
16+
baseUrl={MEDUSA_BACKEND_URL}
17+
queryClientProviderProps={{
18+
client: queryClient,
19+
}}
20+
>
21+
<CartProvider>
22+
<StoreProvider>
23+
<AccountProvider>
24+
<main className="relative">{children}</main>
25+
</AccountProvider>
26+
</StoreProvider>
27+
</CartProvider>
28+
</MedusaProvider>
29+
)
30+
}

src/app/layout.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import Footer from "@modules/layout/templates/footer"
1010
import Nav from "@modules/layout/templates/nav"
1111
import "styles/globals.css"
1212

13-
function RootLayout({ children }: { children: React.ReactNode }) {
13+
export default function RootLayout({
14+
children,
15+
}: {
16+
children: React.ReactNode
17+
}) {
1418
return (
1519
<html lang="en">
1620
<body>
@@ -38,5 +42,3 @@ function RootLayout({ children }: { children: React.ReactNode }) {
3842
</html>
3943
)
4044
}
41-
42-
export default RootLayout

0 commit comments

Comments
 (0)