/
Layout.tsx
45 lines (39 loc) · 1017 Bytes
/
Layout.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
41
42
43
44
45
import React, { ReactNode } from 'react';
import { createGlobalStyle, ThemeProvider } from 'styled-components';
import { ScrollingProvider } from 'react-scroll-section';
import Helmet from './Helmet';
import theme from '../theme';
import { loadIcons } from '../utils/icon-loader';
import 'tippy.js/dist/tippy.css'; // eslint-disable-line
loadIcons();
const GlobalStyle = createGlobalStyle`
*,
*::after,
*::before {
box-sizing: inherit;
}
body {
box-sizing: border-box;
margin: 0;
font-family: Cabin, 'Open Sans', sans-serif;
overflow-x: hidden;
width: 100vw;
background: ${(props) => props.theme.colors.background};
color: ${(props) => props.theme.colors.text};
}
`;
type Props = {
children: ReactNode;
};
const Layout = ({ children }: Props) => (
<main>
<ThemeProvider theme={theme}>
<GlobalStyle />
<ScrollingProvider>
<Helmet />
{children}
</ScrollingProvider>
</ThemeProvider>
</main>
);
export default Layout;