Fix a bunch of layout issues
This commit is contained in:
29
website/src/ui/Box.js
Normal file
29
website/src/ui/Box.js
Normal file
@@ -0,0 +1,29 @@
|
||||
import Radium from 'radium'
|
||||
import PropTypes from 'prop-types'
|
||||
import React, { Component } from 'react'
|
||||
|
||||
class Box extends Component {
|
||||
static propTypes = {
|
||||
borderTop: PropTypes.number,
|
||||
borderBottom: PropTypes.string,
|
||||
borderRight: PropTypes.string,
|
||||
borderLeft: PropTypes.string,
|
||||
border: PropTypes.string,
|
||||
color: PropTypes.string,
|
||||
children: PropTypes.node,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { children, color, borderTop, borderBottom, borderLeft, borderRight, border } = this.props
|
||||
|
||||
return (
|
||||
<div style={[
|
||||
color && { backgroundColor: color },
|
||||
border ? { border } : { borderTop, borderBottom, borderLeft, borderRight }]}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Radium(Box)
|
||||
Reference in New Issue
Block a user