-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgatsby-browser.js
More file actions
28 lines (26 loc) · 852 Bytes
/
gatsby-browser.js
File metadata and controls
28 lines (26 loc) · 852 Bytes
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
import "@fontsource/libre-franklin/300.css"
import "@fontsource/libre-franklin/400.css"
import "@fontsource/libre-franklin/500.css"
import "@fontsource/libre-franklin/600.css"
import "@fontsource/libre-franklin/700.css"
import "./src/styles/global.css"
import React from "react"
import {
PasswordProvider,
ProtectedRoute,
} from "./src/components/password-protect/PasswordContext"
import { SiteProvider } from "./src/context/SiteContext"
// Wrap the app with the password provider and site provider
export const wrapRootElement = ({ element }) => {
return (
<PasswordProvider>
<SiteProvider>
{element}
</SiteProvider>
</PasswordProvider>
)
}
// Wrap the page element with the protected route
export const wrapPageElement = ({ element, props }) => {
return <ProtectedRoute {...props}>{element}</ProtectedRoute>
}