From a30dd26052e6cc7349f174ed23665c3f090e9682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Wed, 19 Jun 2019 19:41:37 +0800 Subject: [PATCH] :up: upgrade rc-progress to 2.4.0 (#17168) --- components/progress/Circle.tsx | 12 +- .../__tests__/__snapshots__/demo.test.js.snap | 128 +++++++++--------- .../__snapshots__/index.test.js.snap | 8 +- components/progress/progress.tsx | 2 +- package.json | 2 +- 5 files changed, 78 insertions(+), 74 deletions(-) diff --git a/components/progress/Circle.tsx b/components/progress/Circle.tsx index 6aa7520d9877..bf6b7865dc87 100644 --- a/components/progress/Circle.tsx +++ b/components/progress/Circle.tsx @@ -17,7 +17,9 @@ const statusColorMap: Record = { function getPercentage({ percent, successPercent }: CircleProps) { const ptg = validProgress(percent); - if (!successPercent) return ptg; + if (!successPercent) { + return ptg; + } const successPtg = validProgress(successPercent); return [successPercent, validProgress(ptg - successPtg)]; @@ -25,7 +27,9 @@ function getPercentage({ percent, successPercent }: CircleProps) { function getStrokeColor({ progressStatus, successPercent, strokeColor }: CircleProps) { const color = strokeColor || statusColorMap[progressStatus]; - if (!successPercent) return color; + if (!successPercent) { + return color; + } return [statusColorMap.success, color]; } @@ -49,7 +53,7 @@ const Circle: React.SFC = props => { }; const circleWidth = strokeWidth || 6; const gapPos = gapPosition || (type === 'dashboard' && 'bottom') || 'top'; - const gapDeg = gapDegree || (type === 'dashboard' && 75); + const gapDeg = gapDegree ? gapDegree : (type === 'dashboard' ? 75 : 0); return (
@@ -57,7 +61,7 @@ const Circle: React.SFC = props => { percent={getPercentage(props)} strokeWidth={circleWidth} trailWidth={circleWidth} - strokeColor={getStrokeColor(props)} + strokeColor={getStrokeColor(props) as string} strokeLinecap={strokeLinecap} trailColor={trailColor} prefixCls={prefixCls} diff --git a/components/progress/__tests__/__snapshots__/demo.test.js.snap b/components/progress/__tests__/__snapshots__/demo.test.js.snap index d42401bf9194..e71491d785b5 100644 --- a/components/progress/__tests__/__snapshots__/demo.test.js.snap +++ b/components/progress/__tests__/__snapshots__/demo.test.js.snap @@ -16,8 +16,8 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `