Improve Progress

This commit is contained in:
ztplz 2018-11-08 17:08:14 +08:00 committed by 偏右
parent cbf9a6a694
commit a545c0c3c5

View File

@ -4,7 +4,7 @@ import Icon from '../icon';
import { Circle } from 'rc-progress';
import classNames from 'classnames';
const statusColorMap = {
const statusColorMap: Record<string, string> = {
normal: '#108ee9',
exception: '#ff5500',
success: '#87d068',
@ -43,16 +43,13 @@ const validProgress = (progress: number | undefined) => {
};
export default class Progress extends React.Component<ProgressProps, {}> {
static Line: any;
static Circle: any;
static defaultProps = {
type: 'line' as ProgressType,
type: 'line',
percent: 0,
showInfo: true,
trailColor: '#f3f3f3',
prefixCls: 'ant-progress',
size: 'default' as ProgressSize,
size: 'default',
};
static propTypes = {
@ -145,7 +142,7 @@ export default class Progress extends React.Component<ProgressProps, {}> {
percent={validProgress(percent)}
strokeWidth={circleWidth}
trailWidth={circleWidth}
strokeColor={strokeColor || (statusColorMap as any)[progressStatus]}
strokeColor={strokeColor || statusColorMap[progressStatus]}
strokeLinecap={strokeLinecap}
trailColor={trailColor}
prefixCls={prefixCls}