Skip to content

Commit 30be2be

Browse files
feat: support button text props
feat: Support button Text props
2 parents c6b69f7 + dd0c820 commit 30be2be

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/InputSpinner.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ class InputSpinner extends Component {
11921192
: this.props.buttonLeftText
11931193
? this.props.buttonLeftText
11941194
: "-";
1195-
return <Text style={this._getStyleLeftButtonText()}>{text}</Text>;
1195+
return <Text {...this.props.buttonTextProps} style={this._getStyleLeftButtonText()}>{text}</Text>;
11961196
}
11971197
}
11981198

@@ -1216,7 +1216,7 @@ class InputSpinner extends Component {
12161216
: this.props.buttonRightText
12171217
? this.props.buttonRightText
12181218
: "+";
1219-
return <Text style={this._getStyleRightButtonText()}>{text}</Text>;
1219+
return <Text {...this.props.buttonTextProps} style={this._getStyleRightButtonText()}>{text}</Text>;
12201220
}
12211221
}
12221222

@@ -1450,6 +1450,7 @@ InputSpinner.propTypes = {
14501450
inputProps: PropTypes.object,
14511451
leftButtonProps: PropTypes.object,
14521452
rightButtonProps: PropTypes.object,
1453+
buttonTextProps: PropTypes.object,
14531454
};
14541455

14551456
InputSpinner.defaultProps = {
@@ -1510,6 +1511,7 @@ InputSpinner.defaultProps = {
15101511
inputProps: null,
15111512
leftButtonProps: null,
15121513
rightButtonProps: null,
1514+
buttonTextProps: null,
15131515
};
15141516

15151517
export default InputSpinner;

src/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {Component} from "react";
2-
import {StyleProp, ViewStyle} from "react-native";
2+
import {StyleProp, TextProps, ViewStyle} from "react-native";
33

44
export interface ReactNativeInputSpinnerProps {
55
type?: string;
@@ -78,5 +78,6 @@ export interface ReactNativeInputSpinnerProps {
7878
inputProps?: object;
7979
leftButtonProps?: object;
8080
rightButtonProps?: object;
81+
buttonTextProps?: TextProps;
8182
}
8283
export default class InputSpinner extends Component<ReactNativeInputSpinnerProps> {}

0 commit comments

Comments
 (0)