diff --git a/README.md b/README.md index 6c2b569..76144d4 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,6 @@ const percentage = 66; | `counterClockwise` | Toggle whether to rotate progressbar in counterclockwise direction. Default: `false`. | | `classes` | Object allowing overrides of classNames of each svg subcomponent (root, trail, path, text, background). Enables styling with react-jss. See [this PR](https://github.com/iqnivek/react-circular-progressbar/pull/25) for more detail. | | `styles` | Object allowing customization of styles of each svg subcomponent (root, trail, path, text, background). | -| `classForPercentage` | **Deprecated** - please use `className` prop instead. Example: `(percent) => percent < 100 ? 'incomplete' : 'complete'`. | -| `textForPercentage` | **Deprecated** - please use `text` prop instead. [See this post](https://github.com/iqnivek/react-circular-progressbar/issues/29#issuecomment-341628016) on how to migrate. Example: ``(pct) => `${pct}%`. | ## Customizing styles diff --git a/docs/demo.jsx b/docs/demo.jsx index b26563e..894462a 100644 --- a/docs/demo.jsx +++ b/docs/demo.jsx @@ -82,6 +82,7 @@ class Demo extends React.Component { backgroundPadding={5} strokeWidth={6} percentage={66} + text={`${66}%`} /> @@ -92,7 +93,6 @@ class Demo extends React.Component {
diff --git a/src/index.jsx b/src/index.jsx index b419619..6010755 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -87,13 +87,6 @@ class CircularProgressbar extends React.Component { return FULL_RADIUS - (this.props.strokeWidth / 2) - this.getBackgroundPadding(); } - getText() { - if (this.props.text) { - return this.props.text; - } - return this.props.textForPercentage ? this.props.textForPercentage(this.props.percentage) : null; - } - render() { const { percentage, @@ -101,14 +94,13 @@ class CircularProgressbar extends React.Component { classes, styles, strokeWidth, + text, } = this.props; - const classForPercentage = this.props.classForPercentage ? this.props.classForPercentage(percentage) : ''; const pathDescription = this.getPathDescription(); - const text = this.getText(); return ( @@ -168,8 +160,6 @@ CircularProgressbar.propTypes = { backgroundPadding: PropTypes.number, initialAnimation: PropTypes.bool, counterClockwise: PropTypes.bool, - classForPercentage: PropTypes.func, - textForPercentage: PropTypes.func, }; CircularProgressbar.defaultProps = { @@ -194,8 +184,6 @@ CircularProgressbar.defaultProps = { backgroundPadding: null, initialAnimation: false, counterClockwise: false, - classForPercentage: null, - textForPercentage: (percentage) => `${percentage}%`, }; export default CircularProgressbar;