forked from nodejs/nodejs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.app.tsx
40 lines (35 loc) · 979 Bytes
/
next.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
import { MotionConfig } from 'framer-motion';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import { SiteProvider } from './providers/siteProvider';
import type { FC, PropsWithChildren } from 'react';
const defaultTypography = [
'Open Sans',
'Roboto',
'San Francisco',
'Helvetica',
'Arial',
'sans-serif',
];
const theme = createTheme({
typography: { fontFamily: defaultTypography.join(',') },
});
export const setAppFont = (font: string) => {
theme.typography.fontFamily = [font, ...defaultTypography].join(',');
};
const BaseApp: FC<PropsWithChildren> = ({ children }) => (
<SiteProvider>
<MotionConfig reducedMotion="user">
<ThemeProvider theme={theme}>
<style jsx global>
{`
body {
font-family: ${theme.typography.fontFamily};
}
`}
</style>
{children}
</ThemeProvider>
</MotionConfig>
</SiteProvider>
);
export default BaseApp;