From 3f8da116cb9646a93cc333c357276419e7bbf12e Mon Sep 17 00:00:00 2001 From: Andy Edwards Date: Mon, 18 Sep 2017 18:03:37 -0500 Subject: [PATCH 1/3] fix(index): support classes prop --- src/index.jsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/index.jsx b/src/index.jsx index 4702bfd..e0726ea 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -74,14 +74,14 @@ class CircularProgressbar extends React.Component { } render() { - const { percentage, textForPercentage, className, strokeWidth } = this.props; + const { percentage, textForPercentage, className, classes, strokeWidth } = this.props; const classForPercentage = this.props.classForPercentage ? this.props.classForPercentage(percentage) : ''; const pathDescription = this.getPathDescription(); const text = textForPercentage ? textForPercentage(percentage) : null; return ( { @@ -96,14 +96,14 @@ class CircularProgressbar extends React.Component { } @@ -129,6 +129,7 @@ class CircularProgressbar extends React.Component { CircularProgressbar.propTypes = { percentage: PropTypes.number.isRequired, className: PropTypes.string, + classes: PropTypes.object, strokeWidth: PropTypes.number, background: PropTypes.bool, backgroundPadding: PropTypes.number, @@ -140,6 +141,12 @@ CircularProgressbar.propTypes = { CircularProgressbar.defaultProps = { strokeWidth: 8, className: '', + classes: { + root: 'CircularProgressbar', + trail: 'CircularProgressbar-trail', + path: 'CircularProgressbar-path', + text: 'CircularProgressbar-text', + }, background: false, backgroundPadding: null, initialAnimation: false, From f968ec68c6804a9165345f6b7a1ec32bb5db8826 Mon Sep 17 00:00:00 2001 From: Kevin Qi Date: Sat, 14 Oct 2017 00:15:11 -0700 Subject: [PATCH 2/3] add classes.background --- src/index.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.jsx b/src/index.jsx index e0726ea..9739a12 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -87,7 +87,7 @@ class CircularProgressbar extends React.Component { { this.props.background ? ( Date: Sat, 14 Oct 2017 00:32:00 -0700 Subject: [PATCH 3/3] more specific proptype declaration --- src/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.jsx b/src/index.jsx index 9739a12..ea30abc 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -129,7 +129,7 @@ class CircularProgressbar extends React.Component { CircularProgressbar.propTypes = { percentage: PropTypes.number.isRequired, className: PropTypes.string, - classes: PropTypes.object, + classes: PropTypes.objectOf(PropTypes.string), strokeWidth: PropTypes.number, background: PropTypes.bool, backgroundPadding: PropTypes.number,