ant-design/components/steps/index.jsx
Bruce Mitchener 63c06e8652 Use ES2015 classes instead of React.createClass.
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.
2016-03-18 09:35:15 +07:00

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;