ant-design/components/layout/row.jsx

26 lines
700 B
React
Raw Normal View History

2015-10-27 23:52:17 +08:00
import React from 'react';
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,
className: React.PropTypes.string,
2015-10-27 23:52:17 +08:00
children: React.PropTypes.node,
},
render() {
const { type, justify, align, className, ...others } = this.props;
const classes = classNames({
row: true,
['row-' + type]: type,
['row-' + type + '-' + justify]: justify,
['row-' + type + '-' + align]: align,
[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;