Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</head>
<body>
<div id="root"></div>
<script src="./index.js"></script>
<script type="module" src="./index.js"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import ReactDOM from 'react-dom'

import './index.css'
import App from './App'
import { createRoot } from 'react-dom/client'

ReactDOM.render(<App />, document.getElementById('root'))
createRoot(document.getElementById('root')).render(<App />)
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{
"name": "react-gradient-progress",
"version": "1.1.2",
"version": "1.2.0",
"description": "Simple and light gradient-enabled circular progressbar for reactjs/nextjs",
"author": "Prasanna Mestha",
"main": "src/index.js",
"main": "build/index.js",
"scripts": {
"start": "parcel ./example/index.html",
"build": "rm -rf build && parcel build src/index.js -d build --no-source-maps --no-minify"
"build": "rm -rf build && parcel build src/index.js --dist-dir build --no-source-maps --no-optimize"
},
"repository": "https://github.com/prasannamestha/react-gradient-progress",
"dependencies": {
"@emotion/react": "^11.1.4",
"@emotion/styled": "^11.0.0",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-dom": "^17.0.1"
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"peerDependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"devDependencies": {
"parcel-bundler": "^1.12.4"
"parcel": "^2.13.3",
"process": "^0.11.10"
},
"keywords": [
"progress",
Expand Down
30 changes: 9 additions & 21 deletions src/GradientCircleProgressbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ const StyledCircle = styled.circle`

const GradientCircleProgressbar = ({
percentage,
width,
strokeWidth,
fontSize,
fontColor,
fontFamily,
primaryColor,
secondaryColor,
fill,
width = 200,
strokeWidth = 5,
fontSize = 'inherit',
fontColor = 'inherit',
fontFamily = 'inherit',
primaryColor = ['#00BBFF', '#92d7f1'],
secondaryColor = 'transparent',
fill = 'transparent',
hidePercentageText,
strokeLinecap,
strokeLinecap = 'round',
}) => {
const PI = 3.14
const R = (width / 2) - (strokeWidth * 2)
Expand Down Expand Up @@ -125,16 +125,4 @@ GradientCircleProgressbar.propTypes = {
hidePercentageText: PropTypes.bool,
}

GradientCircleProgressbar.defaultProps = {
width: 200,
strokeWidth: 5,
strokeLinecap: 'round',
fontSize: 'inherit',
fontColor: 'inherit',
fontFamily: 'inherit',
primaryColor: ['#00BBFF', '#92d7f1'],
secondaryColor: 'transparent',
fill: 'transparent',
}

export default GradientCircleProgressbar
Loading