mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 21:18:01 +08:00
63c06e8652
Make Breadcrumb, Checkbox, Dropdown, Steps and Timeline components use ES2015 classes rather than React.createClass. This includes: * getDefaultProps method becomes a defaultProps value on the constructor. * propTypes becomes a value on the constructor.
31 lines
744 B
JavaScript
31 lines
744 B
JavaScript
import React from 'react';
|
|
import RcSteps from 'rc-steps';
|
|
|
|
export default class Steps extends React.Component {
|
|
render() {
|
|
let maxDescriptionWidth = this.props.maxDescriptionWidth;
|
|
if (this.props.direction === 'vertical') {
|
|
maxDescriptionWidth = 'auto';
|
|
}
|
|
return (
|
|
<RcSteps size={this.props.size}
|
|
current={this.props.current}
|
|
direction={this.props.direction}
|
|
iconPrefix={this.props.iconPrefix}
|
|
maxDescriptionWidth={maxDescriptionWidth}
|
|
prefixCls={this.props.prefixCls}>
|
|
{this.props.children}
|
|
</RcSteps>
|
|
);
|
|
}
|
|
}
|
|
|
|
Steps.defaultProps = {
|
|
prefixCls: 'ant-steps',
|
|
iconPrefix: 'ant',
|
|
maxDescriptionWidth: 100,
|
|
current: 0
|
|
};
|
|
|
|
Steps.Step = RcSteps.Step;
|