2021-03-08 16:26:46 +00:00
|
|
|
import { AppProps } from 'next/app';
|
2022-01-04 23:59:43 +00:00
|
|
|
import { ThemeProvider } from '@mui/material';
|
|
|
|
import { CacheProvider, EmotionCache } from '@emotion/react';
|
|
|
|
|
|
|
|
import createEmotionCache from '../lib/create_emotion_cache/createEmotionCache';
|
2021-03-08 16:26:46 +00:00
|
|
|
import theme from '../theme';
|
2021-02-16 22:50:01 +00:00
|
|
|
import '../styles/globals.css';
|
|
|
|
|
2023-11-27 21:57:25 +00:00
|
|
|
import useSessionExpiryCheck from '../hooks/useSessionExpiryCheck';
|
|
|
|
|
2022-01-04 23:59:43 +00:00
|
|
|
const clientSideEmotionCache = createEmotionCache();
|
|
|
|
|
|
|
|
interface MyAppProps extends AppProps {
|
|
|
|
// eslint-disable-next-line react/require-default-props
|
|
|
|
emotionCache?: EmotionCache;
|
|
|
|
}
|
2021-02-16 22:50:01 +00:00
|
|
|
|
2022-01-04 23:59:43 +00:00
|
|
|
const App = ({
|
|
|
|
Component,
|
|
|
|
emotionCache = clientSideEmotionCache,
|
|
|
|
pageProps,
|
2023-11-27 21:57:25 +00:00
|
|
|
}: MyAppProps): JSX.Element => {
|
|
|
|
useSessionExpiryCheck();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<CacheProvider value={emotionCache}>
|
|
|
|
<ThemeProvider theme={theme}>
|
|
|
|
<Component {...pageProps} />
|
|
|
|
</ThemeProvider>
|
|
|
|
</CacheProvider>
|
|
|
|
);
|
|
|
|
};
|
2021-02-16 22:50:01 +00:00
|
|
|
|
|
|
|
export default App;
|