2015-10-27 23:52:17 +08:00
|
|
|
import React from 'react';
|
2015-11-24 20:03:57 +08:00
|
|
|
import classNames from 'classnames';
|
2015-10-27 23:52:17 +08:00
|
|
|
|
|
|
|
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,
|
2015-10-28 18:04:56 +08:00
|
|
|
className: React.PropTypes.string,
|
2015-10-27 23:52:17 +08:00
|
|
|
children: React.PropTypes.node,
|
|
|
|
},
|
|
|
|
render() {
|
2015-10-28 18:04:56 +08:00
|
|
|
const { type, justify, align, className, ...others } = this.props;
|
2015-11-24 20:03:57 +08:00
|
|
|
const classes = classNames({
|
2016-01-07 17:46:46 +08:00
|
|
|
row: true,
|
2016-02-17 18:04:42 +08:00
|
|
|
[`row-${type}`]: type,
|
|
|
|
[`row-${type}-${justify}`]: justify,
|
|
|
|
[`row-${type}-${align}`]: align,
|
2015-10-28 18:04:56 +08:00
|
|
|
[className]: className,
|
|
|
|
});
|
|
|
|
return <div {...others} className={classes}>{ this.props.children }</div>;
|
2015-10-27 23:52:17 +08:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2015-10-28 00:02:31 +08:00
|
|
|
export default Row;
|