-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.js
More file actions
70 lines (63 loc) · 1.76 KB
/
index.js
File metadata and controls
70 lines (63 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
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { Box } from 'grommet';
import Content from 'components/Content';
import Row from 'components/styled/Row';
const RowStyled = styled(Row)`
margin: 0;
display: flex;
@media (min-width: ${(props) => props.theme.breakpoints.small}) {
margin-right: -${(props) => props.theme.gutter}px;
margin-left: -${(props) => props.theme.gutter}px;
}
`;
const GridSpace = styled((p) => <Box {...p} />)`
@media (min-width: 0px) {
display: none !important;
}
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
display: inline-block !important;
flex-basis: 25%;
}
@media (min-width: ${({ theme }) => theme.breakpoints.medium}) {
display: inline-block !important;
flex-basis: 33%;
}
@media (min-width: ${({ theme }) => theme.breakpoints.large}) {
display: inline-block !important;
flex-basis: 33%;
}
`;
const GridMain = styled((p) => <Box {...p} />)`
padding-right: 0 !important;
padding-left: 0 !important;
@media (min-width: 0px) {
flex-basis: 100%;
}
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
padding-right: ${({ theme }) => theme.gutter}px !important;
padding-left: ${({ theme }) => theme.gutter}px !important;
flex-basis: 50%;
}
@media (min-width: ${({ theme }) => theme.breakpoints.medium}) {
flex-basis: 40%;
}
@media (min-width: ${({ theme }) => theme.breakpoints.large}) {
flex-basis: 33%;
}
`;
const ContentNarrow = ({ children }) => (
<Content>
<RowStyled>
<GridSpace />
<GridMain>
{children}
</GridMain>
</RowStyled>
</Content>
);
ContentNarrow.propTypes = {
children: PropTypes.node,
};
export default ContentNarrow;