-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-ssr.js
29 lines (28 loc) · 898 Bytes
/
gatsby-ssr.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { MedusaProvider } from "medusa-react"
import React from "react"
import { ToastProvider } from "react-toast-notifications"
import "./src/assets/styles/global.css"
import { AccountProvider } from "./src/context/account"
import { CacheProvider } from "./src/context/cache"
import { InterfaceProvider } from "./src/context/interface"
import { medusaUrl, queryClient } from "./src/services/config"
export const wrapPageElement = ({ element }) => {
return (
<MedusaProvider
baseUrl={medusaUrl}
queryClientProviderProps={{
client: queryClient,
}}
>
<CacheProvider>
<AccountProvider>
<InterfaceProvider>
<ToastProvider autoDismiss={true} placement="bottom-left">
{element}
</ToastProvider>
</InterfaceProvider>
</AccountProvider>
</CacheProvider>
</MedusaProvider>
)
}