mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 04:58:55 +08:00
32 lines
637 B
JavaScript
32 lines
637 B
JavaScript
import React from 'react';
|
|
|
|
const Row = React.createClass({
|
|
propTypes: {
|
|
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}`;
|
|
}
|
|
|
|
return <div {...this.props} className={className}>{ this.props.children }</div>;
|
|
},
|
|
});
|
|
|
|
export default Row;
|