diff --git a/react-navigation-addon-search-layout.d.ts b/react-navigation-addon-search-layout.d.ts index 0ac234a..5ead71d 100644 --- a/react-navigation-addon-search-layout.d.ts +++ b/react-navigation-addon-search-layout.d.ts @@ -20,6 +20,9 @@ declare module 'react-navigation-addon-search-layout' { /** Color of text that the user enters into the search box **/ textColor?: string; + /** FontFamily of text that the user enters into the search box and for the text shown as cancel button **/ + textFontFamily?: string; + /** Underline color of the text input on Android **/ searchInputUnderlineColorAndroid?: string; diff --git a/src/SearchBar.ios.js b/src/SearchBar.ios.js index 13472a4..36b097c 100644 --- a/src/SearchBar.ios.js +++ b/src/SearchBar.ios.js @@ -112,6 +112,9 @@ export default class SearchBar extends React.PureComponent { if (this.props.textColor) { searchInputStyle.color = this.props.textColor; } + if (this.props.textFontFamily) { + searchInputStyle.fontFamily = this.props.textFontFamily; + } return ( @@ -154,6 +157,7 @@ export default class SearchBar extends React.PureComponent { style={{ fontSize: 17, color: this.props.tintColor || '#007AFF', + ...(this.props.textFontFamily && { fontFamily: this.props.textFontFamily }), }}> {this.props.cancelButtonText || 'Cancel'} diff --git a/src/SearchBar.js b/src/SearchBar.js index 23d049f..dd97d5a 100644 --- a/src/SearchBar.js +++ b/src/SearchBar.js @@ -21,6 +21,9 @@ export default class SearchBar extends React.PureComponent { if (this.props.textColor) { searchInputStyle.color = this.props.textColor; } + if (this.props.textFontFamily) { + searchInputStyle.fontFamily = this.props.textFontFamily; + } return ( diff --git a/src/SearchLayout.js b/src/SearchLayout.js index 3e3d988..e614cea 100644 --- a/src/SearchLayout.js +++ b/src/SearchLayout.js @@ -43,6 +43,7 @@ export default class SearchLayout extends React.Component { onSubmit={this._handleSubmit} placeholderTextColor={this.props.searchInputPlaceholderTextColor} textColor={this.props.searchInputTextColor} + textFontFamily={this.props.searchInputTextFontFamily} selectionColor={this.props.searchInputSelectionColor} underlineColorAndroid={ this.props.searchInputUnderlineColorAndroid ||