From 190e897d5b300dc54d1fcfcffba6b82fc8bde7e3 Mon Sep 17 00:00:00 2001 From: RimApp Date: Wed, 17 Feb 2021 01:30:11 +0100 Subject: [PATCH 1/2] Add props : titleFontWeight/animationDurationWidth Add possibility to edit the titleFontWeight and animationDurationWidth --- src/index.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 7b7f098..c59e3f0 100644 --- a/src/index.js +++ b/src/index.js @@ -10,20 +10,23 @@ export default class Component extends React.PureComponent { titleColor: PropTypes.string, titleFontFamily: PropTypes.string, titleFontSize: PropTypes.number, - titleWeight: PropTypes.string, + titleFontWeight: PropTypes.number, backgroundColor: PropTypes.string, borderWidth: PropTypes.number, borderRadius: PropTypes.number, activityIndicatorColor: PropTypes.string, + animationDurationWidth: PropTypes.number, onPress: PropTypes.func.isRequired }; static defaultProps = { title: 'Button', titleColor: 'white', + titleFontWeight:'normal', backgroundColor: 'gray', activityIndicatorColor: 'white', - borderRadius: 0 + borderRadius: 0, + animationDurationWidth: 400, }; constructor(props) { @@ -60,7 +63,7 @@ export default class Component extends React.PureComponent { Animated.timing(this.loadingValue.width, { toValue: widthEnd, - duration: 400 + duration: this.props.animationDurationWidth }).start(); Animated.timing(this.loadingValue.borderRadius, { @@ -108,7 +111,7 @@ export default class Component extends React.PureComponent { color: this.props.titleColor, fontFamily: this.props.titleFontFamily, fontSize: this.props.titleFontSize, - fontWeight: this.props.titleWeight + fontWeight: this.props.titleFontWeight } ]} > From 946fc4b2170c7c529fcdbee2f7da81bee460accc Mon Sep 17 00:00:00 2001 From: RimApp Date: Wed, 17 Feb 2021 02:49:23 +0100 Subject: [PATCH 2/2] Update index.js --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index c59e3f0..e7720ce 100644 --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,7 @@ export default class Component extends React.PureComponent { titleColor: PropTypes.string, titleFontFamily: PropTypes.string, titleFontSize: PropTypes.number, - titleFontWeight: PropTypes.number, + titleFontWeight: PropTypes.string, backgroundColor: PropTypes.string, borderWidth: PropTypes.number, borderRadius: PropTypes.number,