Skip to content

Commit 502b57b

Browse files
committed
update code
1 parent 4202892 commit 502b57b

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

src/Circle/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ const Circle: React.FC<ProgressProps> = (props) => {
5353
>;
5454
const isConicGradient = gradient && typeof gradient === 'object';
5555
const mergedStrokeLinecap = isConicGradient ? 'butt' : strokeLinecap;
56-
const { indeterminateStylePops, indeterminateStyleTag } = getIndeterminateCircle({ loading });
56+
const { indeterminateStyleProps, indeterminateStyleAnimation } = getIndeterminateCircle({
57+
loading,
58+
});
5759

5860
const circleStyle = getCircleStyle(
5961
perimeter,
@@ -97,7 +99,7 @@ const Circle: React.FC<ProgressProps> = (props) => {
9799
radius={radius}
98100
prefixCls={prefixCls}
99101
gradientId={gradientId}
100-
style={{ ...circleStyleForStack, ...indeterminateStylePops }}
102+
style={{ ...circleStyleForStack, ...indeterminateStyleProps }}
101103
strokeLinecap={mergedStrokeLinecap}
102104
strokeWidth={strokeWidth}
103105
gapDegree={gapDegree}
@@ -183,7 +185,7 @@ const Circle: React.FC<ProgressProps> = (props) => {
183185
/>
184186
)}
185187
{stepCount ? getStepStokeList() : getStokeList()}
186-
{indeterminateStyleTag}
188+
{indeterminateStyleAnimation}
187189
</svg>
188190
);
189191
};

src/Line.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import classNames from 'classnames';
3-
import { useTransitionDuration, defaultProps, toArray } from './common';
3+
import { useTransitionDuration, defaultProps } from './common';
44
import type { ProgressProps } from './interface';
55
import getIndeterminateLine from './utils/getIndeterminateLine';
66

@@ -36,7 +36,7 @@ const Line: React.FC<ProgressProps> = (props) => {
3636
L ${strokeLinecap === 'round' ? right : 100},${center}`;
3737
const viewBoxString = `0 0 100 ${strokeWidth}`;
3838
let stackPtg = 0;
39-
const { indeterminateStylePops, indeterminateStyleTag } = getIndeterminateLine({
39+
const { indeterminateStyleProps, indeterminateStyleAnimation } = getIndeterminateLine({
4040
loading,
4141
percent: percentList[0],
4242
strokeLinecap,
@@ -78,7 +78,7 @@ const Line: React.FC<ProgressProps> = (props) => {
7878
transition:
7979
transition ||
8080
'stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear',
81-
...indeterminateStylePops,
81+
...indeterminateStyleProps,
8282
};
8383
const color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];
8484
stackPtg += ptg;
@@ -103,7 +103,7 @@ const Line: React.FC<ProgressProps> = (props) => {
103103
/>
104104
);
105105
})}
106-
{indeterminateStyleTag}
106+
{indeterminateStyleAnimation}
107107
</svg>
108108
);
109109
};

src/utils/getIndeterminateCircle.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ interface IndeterminateOption {
77
export default (options: IndeterminateOption) => {
88
if (!options.loading) {
99
return {
10-
indeterminateStylePops: {},
11-
indeterminateStyleTag: null,
10+
indeterminateStyleProps: {},
11+
indeterminateStyleAnimation: null,
1212
};
1313
}
1414

1515
const animationName = 'circle-indeterminate-animate';
1616

1717
return {
18-
indeterminateStylePops: {
18+
indeterminateStyleProps: {
1919
transform: 'rotate(0deg)',
2020
animation: `${animationName} 1s linear infinite`,
2121
},
22-
indeterminateStyleTag: (
22+
indeterminateStyleAnimation: (
2323
<style>
2424
{`@keyframes ${animationName} {
2525
0 % { transform: rotate(0deg);}

src/utils/getIndeterminateLine.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ export default (options: IndeterminateOption) => {
1111
const { percent, strokeLinecap, strokeWidth, loading } = options;
1212
if (!loading) {
1313
return {
14-
indeterminateStylePops: {},
15-
indeterminateStyleTag: null,
14+
indeterminateStyleProps: {},
15+
indeterminateStyleAnimation: null,
1616
};
1717
}
1818
const animationName = 'line-indeterminate-animate';
1919
const strokeDashOffset = 100 - (percent + (strokeLinecap === 'round' ? strokeWidth : 0));
2020

2121
return {
22-
indeterminateStylePops: {
22+
indeterminateStyleProps: {
2323
strokeDasharray: `${percent} 100`,
2424
animation: `${animationName} .6s linear alternate infinite`,
2525
strokeDashoffset: 0,
2626
},
27-
indeterminateStyleTag: (
27+
indeterminateStyleAnimation: (
2828
<style>
2929
{`@keyframes ${animationName} {
3030
0% { stroke-dashoffset: 0; }

0 commit comments

Comments
 (0)