stort/src/pages/_app.tsx

34 lines
1.2 KiB
TypeScript
Raw Normal View History

2024-07-30 16:47:58 +08:00
import { CacheProvider, EmotionCache } from "@emotion/react";
2024-08-06 12:39:19 +08:00
import { CssBaseline } from "@mui/material";
2024-07-30 16:47:58 +08:00
import { AppProps } from "next/app";
import Head from "next/head";
2024-08-06 12:39:19 +08:00
import { Initialization } from "../components/Generic/Initialization";
2024-07-30 16:47:58 +08:00
import { UserThemeProvider } from "../contexts/ThemeContext";
import createEmotionCache from "../lib/createEmotionCache";
import "../styles/global.css";
2024-07-30 11:22:58 +08:00
2024-07-30 16:47:58 +08:00
// 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>
2024-08-02 00:03:57 +08:00
<title>Stort</title>
<meta name="viewport" content="initial-scale=1, width=device-width" />
2024-07-30 16:47:58 +08:00
</Head>
<UserThemeProvider>
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
2024-08-06 12:39:19 +08:00
<Initialization />
2024-07-30 16:47:58 +08:00
<CssBaseline />
<Component {...pageProps} />
</UserThemeProvider>
</CacheProvider>
);
2024-07-30 11:22:58 +08:00
}