Total Complexity | 2 |
Complexity/F | 2 |
Lines of Code | 33 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import React from "react"; |
||
2 | import Head from "next/head"; |
||
3 | import type { AppProps } from 'next/app'; |
||
4 | import {ThemeProvider} from "@material-ui/styles"; |
||
5 | import {CssBaseline} from "@material-ui/core"; |
||
6 | import theme from '../src/theme'; |
||
7 | |||
8 | export default function MyApp(props: AppProps) { |
||
9 | const {Component, pageProps} = props; |
||
10 | |||
11 | React.useEffect(() => { |
||
12 | // Remove the server-side injected CSS. |
||
13 | const jssStyles = document.querySelector('#jss-server-side'); |
||
14 | if (jssStyles) { |
||
15 | jssStyles.parentElement!.removeChild(jssStyles); |
||
16 | } |
||
17 | }, []); |
||
18 | |||
19 | return ( |
||
20 | <React.Fragment> |
||
21 | <Head> |
||
22 | <title>My page</title> |
||
23 | <meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" /> |
||
24 | </Head> |
||
25 | <ThemeProvider theme={theme}> |
||
26 | {/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */} |
||
27 | <CssBaseline /> |
||
28 | <Component {...pageProps} /> |
||
29 | </ThemeProvider> |
||
30 | </React.Fragment> |
||
31 | ); |
||
32 | } |
||
33 |