diff options
author | elijah <elijah@riseup.net> | 2016-08-26 21:09:53 -0700 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-09-01 01:41:24 -0400 |
commit | 62f069ef0af1444089a4d477f05ac7279897fa32 (patch) | |
tree | bde623ee4ec8de240ed5504d3cdbc01c5d6755fc /src/leap/bitmask_js/app/components/area.js | |
parent | 50a258d45e851a865801da9d888037b5869a3489 (diff) |
[feat] added initial bitmask_js (WIP)
Diffstat (limited to 'src/leap/bitmask_js/app/components/area.js')
-rw-r--r-- | src/leap/bitmask_js/app/components/area.js | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/leap/bitmask_js/app/components/area.js b/src/leap/bitmask_js/app/components/area.js new file mode 100644 index 00000000..e903e5f5 --- /dev/null +++ b/src/leap/bitmask_js/app/components/area.js @@ -0,0 +1,65 @@ +// +// A bootstrap panel, but with some extra options +// + +import React from 'react' +// import {Panel} from 'react-bootstrap' + +class Area extends React.Component { + + static get defaultProps() {return{ + position: null, // top or bottom + size: 'small', // small or big + type: null, // light or dark + className: null + }} + + constructor(props) { + super(props) + } + + render() { + let style = {} + let innerstyle = {} + if (this.props.position == 'top') { + style.borderBottomRightRadius = '0px' + style.borderBottomLeftRadius = '0px' + style.marginBottom = '0px' + style.borderBottom = '0px' + if (this.props.size == 'big') { + innerstyle.padding = '25px' + } + } else if (this.props.position == 'bottom') { + style.borderTopRightRadius = '0px' + style.borderTopLeftRadius = '0px' + style.borderTop = '0px' + if (this.props.size == 'big') { + innerstyle.padding = '15px 25px' + } + } + + let type = this.props.type ? "area-" + this.props.type : "" + let className = ['panel', 'panel-default', type, this.props.className].join(' ') + return( + <div className={className} style={style}> + <div className="panel-body" style={innerstyle}> + {this.props.children} + </div> + </div> + ) + } + +} + +// Area.propTypes = { +// children: React.PropTypes.oneOfType([ +// React.PropTypes.element, +// React.PropTypes.arrayOf(React.PropTypes.element) +// ]) +// } + +//Area.propTypes = { +// children: React.PropTypes.element.isRequired +//} + +export default Area |