From 0a6d62c81baa5fb9c99e5c0117a66b110167f8cf Mon Sep 17 00:00:00 2001 From: MattyJ10 Date: Tue, 10 Mar 2020 20:00:52 -0700 Subject: [PATCH] Added boolean prop for indicating that you want to apply the current style to the previous page control indicators --- PageControl.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PageControl.js b/PageControl.js index 7155640..4c6d726 100644 --- a/PageControl.js +++ b/PageControl.js @@ -10,6 +10,7 @@ var PageControl = createReactClass({ numberOfPages: PropTypes.number.isRequired, currentPage: PropTypes.number, hidesForSinglePage: PropTypes.bool, + applyCurrentToPrevious: PropTypes.bool, pageIndicatorTintColor: PropTypes.string, currentPageIndicatorTintColor: PropTypes.string, indicatorSize: PropTypes.object, @@ -23,6 +24,7 @@ var PageControl = createReactClass({ numberOfPages: 0, currentPage: 0, hidesForSinglePage: false, + applyCurrentToPrevious: false, pageIndicatorTintColor: 'gray', currentPageIndicatorTintColor: 'white', indicatorSize: {width: 8, height: 8}, @@ -75,7 +77,8 @@ var PageControl = createReactClass({ return ( this.props.hidesForSinglePage && pages.length <= 1 ? null : {pages.map((el, i) => - + {this.props.applyCurrentToPrevious ? + : } )}