-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add steps support * test: add test case * delete useless default gapDegree Co-authored-by: yangpj17 <yangpj17@chianunicom.com>
- Loading branch information
Showing
5 changed files
with
213 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## steps | ||
|
||
<code src="../examples/steps.tsx"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import * as React from 'react'; | ||
import { useState } from 'react'; | ||
import { Circle } from 'rc-progress'; | ||
|
||
const Example = () => { | ||
|
||
const [percent, setPercent] = useState<number>(30); | ||
const [strokeWidth, setStrokeWidth] = useState<number>(20); | ||
const [steps, setSteps] = useState<number>(5); | ||
const [space, setSpace] = useState<number>(4); | ||
|
||
|
||
return ( | ||
<div> | ||
<div> | ||
percent: <input | ||
id='range' | ||
type='range' | ||
min='0' | ||
max='100' | ||
value={percent} | ||
style={{ width: 300 }} | ||
onChange={(e) => setPercent(parseInt(e.target.value))} /> | ||
</div> | ||
<div> | ||
strokeWidth: <input | ||
id='range' | ||
type='range' | ||
min='0' | ||
max='30' | ||
value={strokeWidth} | ||
style={{ width: 300 }} | ||
onChange={(e) => setStrokeWidth(parseInt(e.target.value))} /> | ||
</div> | ||
<div> | ||
steps: <input | ||
id='range' | ||
type='range' | ||
min='0' | ||
max='15' | ||
value={steps} | ||
style={{ width: 300 }} | ||
onChange={(e) => setSteps(parseInt(e.target.value))} /> | ||
</div> | ||
<div> | ||
space: <input | ||
id='range' | ||
type='range' | ||
min='0' | ||
max='15' | ||
value={space} | ||
style={{ width: 300 }} | ||
onChange={(e) => setSpace(parseInt(e.target.value))} /> | ||
</div> | ||
<h3>Circle Progress:</h3> | ||
<div>percent: {percent}% </div> | ||
<div>strokeWidth: {strokeWidth}px</div> | ||
<div>steps: {steps}</div> | ||
<div>space: {space}px</div> | ||
|
||
<div style={{ width: 100 }}> | ||
<Circle | ||
percent={percent} | ||
strokeWidth={strokeWidth} | ||
steps={{ | ||
count: steps, | ||
space: space, | ||
}} | ||
strokeColor={'red'} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Example; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80ea029
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
progress – ./
progress-flax.vercel.app
progress-git-master-react-component.vercel.app
progress-react-component.vercel.app