main
|
Last change
on this file since ad311c3 was 40ac7a9, checked in by Mihail <mihail2.naumov@…>, 7 months ago |
|
Added frontend elements
|
-
Property mode
set to
100644
|
|
File size:
1.9 KB
|
| Line | |
|---|
| 1 | import React from 'react';
|
|---|
| 2 | import { PageContextProvider } from './usePageContext';
|
|---|
| 3 | import { CacheProvider } from '@emotion/react';
|
|---|
| 4 | import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|---|
| 5 | import CssBaseline from '@mui/material/CssBaseline';
|
|---|
| 6 | import { EmotionCache } from '@emotion/cache';
|
|---|
| 7 | import Box from '@mui/material/Box';
|
|---|
| 8 | import Navbar from '../components/Navbar';
|
|---|
| 9 | import Footer from '../components/Footer';
|
|---|
| 10 |
|
|---|
| 11 | const theme = createTheme({
|
|---|
| 12 | palette: {
|
|---|
| 13 | mode: 'dark',
|
|---|
| 14 | primary: {
|
|---|
| 15 | main: '#90caf9',
|
|---|
| 16 | },
|
|---|
| 17 | background: {
|
|---|
| 18 | default: '#121212',
|
|---|
| 19 | paper: '#1e1e1e',
|
|---|
| 20 | },
|
|---|
| 21 | },
|
|---|
| 22 | typography: {
|
|---|
| 23 | fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
|
|---|
| 24 | },
|
|---|
| 25 | });
|
|---|
| 26 |
|
|---|
| 27 | export function PageShell({children, pageContext, emotionCache,}: {
|
|---|
| 28 | children: React.ReactNode;
|
|---|
| 29 | pageContext: any;
|
|---|
| 30 | emotionCache: EmotionCache;
|
|---|
| 31 | }) {
|
|---|
| 32 | return (
|
|---|
| 33 | <React.StrictMode>
|
|---|
| 34 | <PageContextProvider pageContext={pageContext}>
|
|---|
| 35 | <CacheProvider value={emotionCache}>
|
|---|
| 36 | <ThemeProvider theme={theme}>
|
|---|
| 37 | <CssBaseline />
|
|---|
| 38 | <Box
|
|---|
| 39 | sx={{
|
|---|
| 40 | display: 'flex',
|
|---|
| 41 | flexDirection: 'column',
|
|---|
| 42 | minHeight: '100vh',
|
|---|
| 43 | bgcolor: 'background.default',
|
|---|
| 44 | color: 'text.primary',
|
|---|
| 45 | }}
|
|---|
| 46 | >
|
|---|
| 47 | <Navbar />
|
|---|
| 48 | <Box component="main" sx={{ flexGrow: 1, py: 3 }}>
|
|---|
| 49 | {children}
|
|---|
| 50 | </Box>
|
|---|
| 51 | <Footer />
|
|---|
| 52 | </Box>
|
|---|
| 53 | </ThemeProvider>
|
|---|
| 54 | </CacheProvider>
|
|---|
| 55 | </PageContextProvider>
|
|---|
| 56 | </React.StrictMode>
|
|---|
| 57 | );
|
|---|
| 58 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.