-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathBox.js
More file actions
75 lines (60 loc) · 1.18 KB
/
Box.js
File metadata and controls
75 lines (60 loc) · 1.18 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
72
73
74
75
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
const Box = styled(
({ component,
children,
...props }) => React.createElement(component, props, children),
)`
&&& {
margin-right: auto;
margin-left: auto;
&::before,
&::after {
content: " ";
display: table;
}
&::after {
clear: both;
}
@media (max-width: 767px) {
padding: 0;
}
@media (min-width: 768px) {
width: 750px;
}
@media (min-width: 870px) {
width: 830px;
}
@media (min-width: 930px) {
width: 890px;
}
@media (min-width: 992px) {
width: 970px;
}
@media (min-width: 1050px) {
width: 1020px;
}
@media (min-width: 1100px) {
width: 1070px;
}
@media (min-width: 1200px) {
width: 1170px;
}
@media (min-width: 1300px) {
width: 1250px;
}
@media (min-width: 1400px) {
width: 1330px;
}
}
`;
Box.propTypes = {
component: PropTypes.node,
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
};
Box.defaultProps = {
children: null,
component: 'div',
};
export default Box;