38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { CacheProvider, EmotionCache } from "@emotion/react";
|
|
import { CssBaseline } from "@mui/material";
|
|
import { AppProps } from "next/app";
|
|
import Head from "next/head";
|
|
import { UserThemeProvider } from "../contexts/ThemeContext";
|
|
import createEmotionCache from "../lib/createEmotionCache";
|
|
import "../styles/global.css";
|
|
import { NotificationProvider } from "../contexts/NotificationContext";
|
|
|
|
// Client-side cache, shared for the whole session of the user in the browser.
|
|
const clientSideEmotionCache = createEmotionCache();
|
|
|
|
export interface MyAppProps extends AppProps {
|
|
emotionCache?: EmotionCache;
|
|
}
|
|
|
|
export default function MyApp(props: MyAppProps) {
|
|
const { Component, emotionCache = clientSideEmotionCache, pageProps } = props;
|
|
return (
|
|
<CacheProvider value={emotionCache}>
|
|
<Head>
|
|
<title>CSPJ Application</title>
|
|
<meta
|
|
name='viewport'
|
|
content='initial-scale=1, width=device-width'
|
|
/>
|
|
</Head>
|
|
<UserThemeProvider>
|
|
<NotificationProvider>
|
|
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
|
|
<CssBaseline />
|
|
<Component {...pageProps} />
|
|
</NotificationProvider>
|
|
</UserThemeProvider>
|
|
</CacheProvider>
|
|
);
|
|
}
|