forked from smlxl/evm.codes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_app.tsx
49 lines (39 loc) · 1.36 KB
/
_app.tsx
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { ReactElement, ReactNode } from 'react'
import { KBarProvider } from 'kbar'
import useActions from 'lib/useActions'
import type { NextPage } from 'next'
import type { AppProps } from 'next/app'
import PlausibleProvider from 'next-plausible'
import { ThemeProvider } from 'next-themes'
import { EthereumProvider } from 'context/ethereumContext'
import { SettingsProvider } from 'context/settingsContext'
import KBar from 'components/KBar'
import '../styles/globals.css'
import '../styles/highlight/atom-one-light.css'
import '../styles/highlight/atom-one-dark.css'
type NextPageWithLayout = NextPage & {
getLayout?: (page: ReactElement) => ReactNode
}
type AppPropsWithLayout = AppProps & {
Component: NextPageWithLayout
}
const Main = ({ Component, pageProps }: AppPropsWithLayout) => {
const actions = useActions()
// Use the layout defined at the page level, if available
const getLayout = Component.getLayout ?? ((page) => page)
return (
<PlausibleProvider domain="evm.codes">
<ThemeProvider attribute="class">
<SettingsProvider>
<EthereumProvider>
<KBarProvider actions={actions}>
{getLayout(<Component {...pageProps} />)}
<KBar />
</KBarProvider>
</EthereumProvider>
</SettingsProvider>
</ThemeProvider>
</PlausibleProvider>
)
}
export default Main