-
Notifications
You must be signed in to change notification settings - Fork 2
/
row.js
43 lines (38 loc) · 1018 Bytes
/
row.js
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
var React = require('react');
module.exports = React.createClass ({
displayName: 'Row',
render: function () {
var styles = {
row: {
marginLeft: '-15px',
marginRight: '-15px',
boxSizing: 'border-box',
},
before: {
content: ' ',
display: 'table',
},
after: {
content: ' ',
display: 'table',
clear: 'both',
}
};
if (this.props.padding === 0 || this.props.padding){
styles.row.paddingLeft = this.props.padding + 'px';
styles.row.paddingRight = this.props.padding + 'px';
}
if (this.props.style){
for (var key in this.props.style) { styles.row[key] = this.props.style[key]; }
}
return (
React.createElement("div", null,
React.createElement("div", {style: styles.before}),
React.createElement("div", {style: styles.row},
this.props.children
),
React.createElement("div", {style: styles.after})
)
);
}
});