Skip to content

Commit 3fd6744

Browse files
authored
Merge pull request #1 from ccamposfuentes/master
Add custom width and background color
2 parents 2dbe11f + 980d922 commit 3fd6744

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ const App = () => {
3030
* percentage (default: 80)
3131
* blankColor (default: "#eaeaea")
3232
* donutColor (default: "#43cdcf")
33+
* fillColor (default: "white")
34+
* progressWidth (default: 35)

src/CircularProgress.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ function generateArc(percentage){
3838
const CircularProgress = ({
3939
percentage = 40,
4040
blankColor = "#eaeaea",
41-
donutColor = "#43cdcf",
41+
donutColor = "#43cdcf",
42+
fillColor = "white",
43+
progressWidth = 35,
4244
children
4345
}) => {
4446
return <View style={styles.base}>
@@ -48,7 +50,7 @@ const CircularProgress = ({
4850
d={`M50 50 L50 0 ${generateArc(percentage)} Z`}
4951
fill={donutColor}
5052
/>
51-
{<Circle cx="50" cy="50" r="35" fill="white"/>}
53+
{<Circle cx="50" cy="50" r={progressWidth} fill={fillColor}/>}
5254
</Svg>
5355
<View style={styles.textView}>
5456
{children}

0 commit comments

Comments
 (0)