Selectable List in place
This commit is contained in:
@@ -2,6 +2,8 @@ import Radium from 'radium'
|
||||
import PropTypes from 'prop-types'
|
||||
import React, { Component } from 'react'
|
||||
|
||||
// TODO: Refactor this to allow setting each border property separately
|
||||
|
||||
class Box extends Component {
|
||||
static propTypes = {
|
||||
borderTop: PropTypes.string,
|
||||
@@ -9,17 +11,19 @@ class Box extends Component {
|
||||
borderRight: PropTypes.string,
|
||||
borderLeft: PropTypes.string,
|
||||
border: PropTypes.string,
|
||||
radius: PropTypes.number,
|
||||
color: PropTypes.string,
|
||||
children: PropTypes.node,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { children, color, borderTop, borderBottom, borderLeft, borderRight, border } = this.props
|
||||
const { children, color, borderTop, borderBottom, borderLeft, borderRight, border, radius } = this.props
|
||||
|
||||
return (
|
||||
<div style={[
|
||||
{ height: '100%', width: '100%' },
|
||||
color && { backgroundColor: color },
|
||||
radius && { borderRadius: radius },
|
||||
border ? { border } : { borderTop, borderBottom, borderLeft, borderRight }]}>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user