diff --git a/demo/demo.jsx b/demo/demo.jsx index fe207d0..442eff8 100644 --- a/demo/demo.jsx +++ b/demo/demo.jsx @@ -31,11 +31,9 @@ class ChangingProgressbar extends React.Component { componentDidMount() { setInterval(() => { - if (this.state.percentage < 100) { - this.setState({ - percentage: Math.min(this.state.percentage + 20, 100) - }); - } + this.setState({ + percentage: (this.state.percentage + 20) % 120 + }); }, 1000); } @@ -61,9 +59,6 @@ class Demo extends React.Component {
- (percentage < 50 ? 'low' : 'high')} - />
@@ -73,6 +68,18 @@ class Demo extends React.Component { View project on Github +
+
+
+ { + return percentage < 50 ? 'low' : 'high'; + }} + /> +

Configure it to change based on percentage. Using plain old CSS classes.

+
+
+

Configuration

diff --git a/src/index.jsx b/src/index.jsx index fc5f7be..7bd74cf 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -21,7 +21,7 @@ class CircularProgressbar extends React.Component { return (