mirror of
https://github.com/dstotijn/hetty.git
synced 2025-07-01 18:47:29 -04:00
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
![]() |
import React from "react";
|
||
|
import { AppProps } from "next/app";
|
||
|
import { ApolloProvider } from "@apollo/client";
|
||
|
import Head from "next/head";
|
||
|
import { ThemeProvider } from "@material-ui/core/styles";
|
||
|
import CssBaseline from "@material-ui/core/CssBaseline";
|
||
|
|
||
|
import theme from "../lib/theme";
|
||
|
import { useApollo } from "../lib/graphql";
|
||
|
|
||
|
function App({ Component, pageProps }: AppProps): JSX.Element {
|
||
|
const apolloClient = useApollo(pageProps.initialApolloState);
|
||
|
|
||
|
React.useEffect(() => {
|
||
|
// Remove the server-side injected CSS.
|
||
|
const jssStyles = document.querySelector("#jss-server-side");
|
||
|
if (jssStyles) {
|
||
|
jssStyles.parentElement.removeChild(jssStyles);
|
||
|
}
|
||
|
}, []);
|
||
|
|
||
|
return (
|
||
|
<React.Fragment>
|
||
|
<Head>
|
||
|
<title>gurp</title>
|
||
|
<meta
|
||
|
name="viewport"
|
||
|
content="minimum-scale=1, initial-scale=1, width=device-width"
|
||
|
/>
|
||
|
</Head>
|
||
|
<ApolloProvider client={apolloClient}>
|
||
|
<ThemeProvider theme={theme}>
|
||
|
<CssBaseline />
|
||
|
<Component {...pageProps} />
|
||
|
</ThemeProvider>
|
||
|
</ApolloProvider>
|
||
|
</React.Fragment>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default App;
|