-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path_app.js
36 lines (31 loc) · 1.09 KB
/
_app.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
30
31
32
33
34
35
36
import Layout from '@/components/layout/Layout';
import { useState } from 'react';
import { ThemeProvider } from 'styled-components';
import { lightTheme, darkTheme, GlobalStyles } from '@/styles/themeConfig';
function MyApp({ Component, pageProps }) {
// Only uncomment when the darkTheme is set
// const [theme, setTheme] = useState('light');
// const toggleTheme = () => {
// theme == 'light' ? setTheme('dark') : setTheme(light);
// };
return (
<ThemeProvider theme={lightTheme}>
<GlobalStyles />
<Layout>
<Component {...pageProps} />
</Layout>
</ThemeProvider>
);
}
// Only uncomment this method if you have blocking data requirements for
// every single page in your application. This disables the ability to
// perform automatic static optimization, causing every page in your app to
// be server-side rendered.
//
// MyApp.getInitialProps = async (appContext) => {
// // calls page's `getInitialProps` and fills `appProps.pageProps`
// const appProps = await App.getInitialProps(appContext);
//
// return { ...appProps }
// }
export default MyApp;