2015-10-27 23:52:17 +08:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
const Row = React.createClass({
|
2015-10-28 00:02:31 +08:00
|
|
|
propTypes: {
|
2015-10-27 23:52:17 +08:00
|
|
|
type: React.PropTypes.string,
|
|
|
|
align: React.PropTypes.string,
|
|
|
|
justify: React.PropTypes.string,
|
|
|
|
children: React.PropTypes.node,
|
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { type, justify, align } = this.props;
|
|
|
|
let className = 'row';
|
|
|
|
|
|
|
|
if (type || justify || align) {
|
|
|
|
className += ` row-flex`;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (justify) {
|
|
|
|
className += ` row-flex-${justify}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (align) {
|
|
|
|
className += ` row-flex-${align}`;
|
|
|
|
}
|
|
|
|
|
2015-10-28 00:02:31 +08:00
|
|
|
return <div {...this.props} className={className}>{ this.props.children }</div>;
|
2015-10-27 23:52:17 +08:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2015-10-28 00:02:31 +08:00
|
|
|
export default Row;
|