forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.js
More file actions
71 lines (62 loc) · 1.76 KB
/
layout.js
File metadata and controls
71 lines (62 loc) · 1.76 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import React from 'react';
import { ThemeProvider } from 'styled-components';
import theme from '@codesandbox/common/lib/theme';
import { VisuallyHidden } from './style';
import '../css/typography.css';
import '../css/global.css';
import Navigation from './Navigation/index';
import Footer from './Footer';
const text = number => `@media only screen and (max-width: ${number}px)`;
export const SMALL_BREAKPOINT = 576;
export const MEDIUM_BREAKPOINT = 768;
export const LARGE_BREAKPOINT = 1024;
export const EXTRA_LARGE_BREAKPOINT = 1200;
const homepageTheme = {
...theme,
breakpoints: {
sm: text(SMALL_BREAKPOINT),
md: text(MEDIUM_BREAKPOINT),
lg: text(LARGE_BREAKPOINT),
xl: text(EXTRA_LARGE_BREAKPOINT),
},
homepage: {
appleFont:
"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue'",
white: '#fff',
whiteDark: '#e6e6e6',
primary: '#0971f1',
greyLight: '#757575',
grey: '#242424',
greyDark: '#040404',
muted: '#999',
blue: '#0971F1',
black: '#000',
},
};
export const WRAPPER_STYLING = {
maxWidth: '80%',
width: '1200px',
margin: 'auto',
};
export const useTheme = () => homepageTheme;
const TemplateWrapper = ({ children, noWrapperStyling }) => (
<ThemeProvider theme={homepageTheme}>
<div>
<div style={{ position: 'absolute', left: 0, right: 0, zIndex: 10 }}>
<VisuallyHidden as="a" href="#main">
Skip to main content
</VisuallyHidden>
</div>
<Navigation />
<main
style={noWrapperStyling ? {} : WRAPPER_STYLING}
id="main"
aria-label="main content"
>
{children}
</main>
<Footer />
</div>
</ThemeProvider>
);
export default TemplateWrapper;