Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit a97b510

Browse files
committed
Added search input text font option
1 parent d834bee commit a97b510

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/SearchBar.ios.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ export default class SearchBar extends React.PureComponent {
112112
if (this.props.textColor) {
113113
searchInputStyle.color = this.props.textColor;
114114
}
115+
if (this.props.textFont) {
116+
searchInputStyle.fontFamily = this.props.textFont;
117+
}
115118

116119
return (
117120
<View style={styles.container}>
@@ -151,10 +154,10 @@ export default class SearchBar extends React.PureComponent {
151154
onLayout={this._handleLayoutCancelButton}
152155
onPress={this._handlePressCancelButton}>
153156
<Text
154-
style={{
157+
style={[{
155158
fontSize: 17,
156159
color: this.props.tintColor || '#007AFF',
157-
}}>
160+
}, this.props.textFont ? { fontFamily: this.props.textFont } : null]}>
158161
{this.props.cancelButtonText || 'Cancel'}
159162
</Text>
160163
</TouchableOpacity>

src/SearchBar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export default class SearchBar extends React.PureComponent {
2121
if (this.props.textColor) {
2222
searchInputStyle.color = this.props.textColor;
2323
}
24+
if (this.props.textFont) {
25+
searchInputStyle.fontFamily = this.props.textFont;
26+
}
2427

2528
return (
2629
<View style={styles.container}>

src/SearchLayout.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default class SearchLayout extends React.Component {
4343
onSubmit={this._handleSubmit}
4444
placeholderTextColor={this.props.searchInputPlaceholderTextColor}
4545
textColor={this.props.searchInputTextColor}
46+
textFont={this.props.searchInputTextFont}
4647
selectionColor={this.props.searchInputSelectionColor}
4748
underlineColorAndroid={
4849
this.props.searchInputUnderlineColorAndroid ||

0 commit comments

Comments
 (0)