-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_app.tsx
executable file
·45 lines (40 loc) · 1.54 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
import { CacheProvider, EmotionCache, Global } from "@emotion/react";
import CssBaseline from "@mui/material/CssBaseline";
import { ThemeProvider } from "@mui/material/styles";
import { AppProps } from "next/app";
import Head from "next/head";
import { MetricCatalogProvider } from "@actnowcoalition/actnow.js";
import AppBar from "components/AppBar";
import Footer from "components/Footer";
import { globalStyles } from "src/styles";
import createEmotionCache from "src/styles/createEmotionCache";
import theme from "src/styles/theme";
import { AnalyticsSetup } from "src/utils/analytics";
import { metricCatalog } from "src/utils/metrics";
// Client-side cache, shared for the whole session of the user in the browser.
const clientSideEmotionCache = createEmotionCache();
interface MyAppProps extends AppProps {
emotionCache?: EmotionCache;
}
export default function MyApp(props: MyAppProps) {
const { Component, emotionCache = clientSideEmotionCache, pageProps } = props;
return (
<CacheProvider value={emotionCache}>
<Global styles={globalStyles} />
<Head>
<title>Page title</title>
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="initial-scale=1, width=device-width" />
</Head>
<ThemeProvider theme={theme}>
<AnalyticsSetup />
<CssBaseline />
<MetricCatalogProvider metricCatalog={metricCatalog}>
<AppBar />
<Component {...pageProps} />
<Footer />
</MetricCatalogProvider>
</ThemeProvider>
</CacheProvider>
);
}