|
1 | 1 | /** @jsx jsx */ |
2 | 2 | import { jsx, Styled } from 'theme-ui' |
3 | | -import { Container } from '@theme-ui/components' |
| 3 | +import { Global } from '@emotion/core' |
| 4 | +import { Container, Box } from '@theme-ui/components' |
4 | 5 | import { Link } from 'gatsby' |
| 6 | +import { Twitter, GitHub } from 'react-feather' |
5 | 7 |
|
6 | | -export default ({ children }) => ( |
| 8 | +import Nav from '../nav.mdx' |
| 9 | + |
| 10 | +export default ({ children, title }) => ( |
7 | 11 | <Styled.root> |
8 | | - <title>Blocks UI</title> |
9 | | - <Container as="main" mb={[3, 4, 5]}> |
10 | | - <Link to="/"> |
11 | | - <img |
12 | | - src="https://user-images.githubusercontent.com/1424573/61592179-e0fda080-ab8c-11e9-9109-166cc7c86b43.png" |
13 | | - alt="blocks logo" |
14 | | - width="80" |
15 | | - style={{ |
16 | | - marginTop: 128, |
17 | | - marginLeft: -5, |
18 | | - marginBottom: 8 |
| 12 | + <title>{title ? title + ' / ' : null} Blocks UI</title> |
| 13 | + <Global |
| 14 | + styles={{ |
| 15 | + '*': { |
| 16 | + boxSizing: 'border-box' |
| 17 | + }, |
| 18 | + body: { |
| 19 | + margin: 0 |
| 20 | + } |
| 21 | + }} |
| 22 | + /> |
| 23 | + <Box |
| 24 | + sx={{ |
| 25 | + display: 'grid', |
| 26 | + minHeight: '100vh', |
| 27 | + gridTemplateAreas: [ |
| 28 | + '"header" "nav" "main" "toc" "footer"', |
| 29 | + '"header header header" "nav main toc" "footer footer footer"' |
| 30 | + ], |
| 31 | + gridTemplateColumns: ['1fr', '240px 1fr 240px'], |
| 32 | + gridTemplateRows: [ |
| 33 | + 'min-content min-content 1fr min-content min-content', |
| 34 | + 'min-content 1fr min-content' |
| 35 | + ] |
| 36 | + }} |
| 37 | + > |
| 38 | + <Box |
| 39 | + sx={{ |
| 40 | + gridArea: 'header', |
| 41 | + borderBottom: 'thin solid #e1e6eb', |
| 42 | + py: 2, |
| 43 | + px: 3, |
| 44 | + display: 'flex', |
| 45 | + aligntItems: 'center', |
| 46 | + justifyContent: 'space-between' |
| 47 | + }} |
| 48 | + > |
| 49 | + <Link |
| 50 | + to="/" |
| 51 | + sx={{ |
| 52 | + textDecoration: 'none', |
| 53 | + color: 'inherit', |
| 54 | + display: 'flex', |
| 55 | + alignItems: 'center' |
| 56 | + }} |
| 57 | + > |
| 58 | + <img |
| 59 | + src="https://user-images.githubusercontent.com/1424573/61592179-e0fda080-ab8c-11e9-9109-166cc7c86b43.png" |
| 60 | + alt="blocks logo" |
| 61 | + width="32" |
| 62 | + sx={{ |
| 63 | + verticalAlign: 'middle', |
| 64 | + ml: '-4px', |
| 65 | + mr: 2 |
| 66 | + }} |
| 67 | + /> |
| 68 | + Blocks |
| 69 | + </Link> |
| 70 | + <div |
| 71 | + sx={{ |
| 72 | + display: 'flex', |
| 73 | + alignItems: 'center', |
| 74 | + verticalAlign: 'middle' |
| 75 | + }} |
| 76 | + > |
| 77 | + <a |
| 78 | + href="https://github.com/blocks/blocks" |
| 79 | + sx={{ |
| 80 | + mt: '5px', |
| 81 | + color: 'inherit' |
| 82 | + }} |
| 83 | + > |
| 84 | + <GitHub size={18} /> |
| 85 | + </a> |
| 86 | + <a |
| 87 | + href="https://github.com/blocks/blocks" |
| 88 | + sx={{ |
| 89 | + mt: '5px', |
| 90 | + color: 'inherit', |
| 91 | + ml: 3 |
| 92 | + }} |
| 93 | + > |
| 94 | + <Twitter size={18} /> |
| 95 | + </a> |
| 96 | + </div> |
| 97 | + </Box> |
| 98 | + <Box |
| 99 | + sx={{ |
| 100 | + gridArea: 'main' |
| 101 | + }} |
| 102 | + > |
| 103 | + <Container sx={{ px: 3, py: [3, 4, 4] }}>{children}</Container> |
| 104 | + </Box> |
| 105 | + <Box |
| 106 | + sx={{ |
| 107 | + gridArea: 'nav', |
| 108 | + px: 3, |
| 109 | + py: [3, 4, 4], |
| 110 | + mt: '10px', |
| 111 | + ul: { |
| 112 | + listStyle: 'none', |
| 113 | + p: 0 |
| 114 | + }, |
| 115 | + li: { |
| 116 | + mb: 1, |
| 117 | + fontSize: 1, |
| 118 | + ul: { |
| 119 | + li: { |
| 120 | + mb: 0 |
| 121 | + }, |
| 122 | + pl: 2, |
| 123 | + a: { |
| 124 | + fontWeight: 400, |
| 125 | + color: '#2f353b' |
| 126 | + } |
| 127 | + }, |
| 128 | + a: { |
| 129 | + color: 'black', |
| 130 | + fontWeight: 500, |
| 131 | + textDecoration: 'none', |
| 132 | + '&:hover': { |
| 133 | + color: 'black' |
| 134 | + } |
| 135 | + } |
| 136 | + } |
| 137 | + }} |
| 138 | + > |
| 139 | + <Nav /> |
| 140 | + </Box> |
| 141 | + <Box |
| 142 | + sx={{ |
| 143 | + gridArea: 'toc' |
| 144 | + }} |
| 145 | + ></Box> |
| 146 | + <Box |
| 147 | + as="footer" |
| 148 | + sx={{ |
| 149 | + gridArea: 'footer', |
| 150 | + py: [3, 5, 6], |
| 151 | + mt: [3, 4, 5], |
| 152 | + backgroundColor: 'text', |
| 153 | + color: 'background' |
| 154 | + }} |
| 155 | + > |
| 156 | + <Container |
| 157 | + sx={{ |
| 158 | + px: 3, |
| 159 | + display: 'flex', |
| 160 | + alignItems: 'center', |
| 161 | + verticalAlign: 'middle' |
19 | 162 | }} |
20 | | - /> |
21 | | - </Link> |
22 | | - {children} |
23 | | - </Container> |
| 163 | + > |
| 164 | + <Link to="/"> |
| 165 | + <img |
| 166 | + src="https://user-images.githubusercontent.com/1424573/61592179-e0fda080-ab8c-11e9-9109-166cc7c86b43.png" |
| 167 | + alt="blocks logo" |
| 168 | + width="32" |
| 169 | + sx={{ |
| 170 | + verticalAlign: 'middle', |
| 171 | + mr: 4 |
| 172 | + }} |
| 173 | + /> |
| 174 | + </Link> |
| 175 | + <a |
| 176 | + href="https://github.com/blocks/blocks" |
| 177 | + sx={{ |
| 178 | + mt: '5px', |
| 179 | + ml: 'auto', |
| 180 | + color: 'inherit' |
| 181 | + }} |
| 182 | + > |
| 183 | + <GitHub size={18} /> |
| 184 | + </a> |
| 185 | + <a |
| 186 | + href="https://github.com/blocks/blocks" |
| 187 | + sx={{ |
| 188 | + mt: '5px', |
| 189 | + color: 'inherit', |
| 190 | + ml: 3 |
| 191 | + }} |
| 192 | + > |
| 193 | + <Twitter size={18} /> |
| 194 | + </a> |
| 195 | + </Container> |
| 196 | + </Box> |
| 197 | + </Box> |
24 | 198 | </Styled.root> |
25 | 199 | ) |
0 commit comments