Improved headers search bar design

This commit is contained in:
keplyx 2019-11-15 16:44:10 +01:00
parent dd11fcc2c7
commit edfb32667c
3 changed files with 11 additions and 4 deletions

View file

@ -47,8 +47,13 @@ export default class CustomHeader extends React.Component<Props> {
width: '100%', width: '100%',
marginBottom: 7 marginBottom: 7
}}> }}>
<Input placeholder={i18n.t('proximoScreen.search')} <CustomMaterialIcon
onChangeText={(text) => this.props.searchCallback(text)}/> icon={'magnify'}
color={ThemeManager.getCurrentThemeVariables().toolbarBtnColor}/>
<Input
placeholder={i18n.t('proximoScreen.search')}
placeholderTextColor={ThemeManager.getCurrentThemeVariables().toolbarPlaceholderColor}
onChangeText={(text) => this.props.searchCallback(text)}/>
</Item> </Item>
); );
} }
@ -71,7 +76,7 @@ export default class CustomHeader extends React.Component<Props> {
return ( return (
<Header style={styles.header} <Header style={styles.header}
hasTabs={this.props.hasTabs}> hasTabs={this.props.hasTabs}>
<Left> <Left style={{flex: 0}}>
{button} {button}
</Left> </Left>
<Body> <Body>
@ -79,7 +84,7 @@ export default class CustomHeader extends React.Component<Props> {
this.getSearchBar() : this.getSearchBar() :
<Title>{this.props.title}</Title>} <Title>{this.props.title}</Title>}
</Body> </Body>
<Right> <Right style={{flex: this.props.hasSearchField ? 0 : 1}}>
{this.props.rightButton} {this.props.rightButton}
{this.props.hasBackButton ? <View/> : {this.props.hasBackButton ? <View/> :
<Touchable <Touchable

View file

@ -154,6 +154,7 @@ export default {
toolbarHeight: platform === "ios" ? 64 : 56, toolbarHeight: platform === "ios" ? 64 : 56,
toolbarSearchIconSize: platform === "ios" ? 20 : 23, toolbarSearchIconSize: platform === "ios" ? 20 : 23,
toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff", toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff",
toolbarPlaceholderColor: platform === "ios" ? "#CECDD2" : "#CECDD2",
searchBarHeight: platform === "ios" ? 30 : 40, searchBarHeight: platform === "ios" ? 30 : 40,
searchBarInputHeight: platform === "ios" ? 30 : 50, searchBarInputHeight: platform === "ios" ? 30 : 50,
toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff", toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff",

View file

@ -155,6 +155,7 @@ export default {
toolbarHeight: platform === "ios" ? 64 : 56, toolbarHeight: platform === "ios" ? 64 : 56,
toolbarSearchIconSize: platform === "ios" ? 20 : 23, toolbarSearchIconSize: platform === "ios" ? 20 : 23,
toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff", toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff",
toolbarPlaceholderColor: platform === "ios" ? "#CECDD2" : "#CECDD2",
searchBarHeight: platform === "ios" ? 30 : 40, searchBarHeight: platform === "ios" ? 30 : 40,
searchBarInputHeight: platform === "ios" ? 30 : 50, searchBarInputHeight: platform === "ios" ? 30 : 50,
toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff", toolbarBtnTextColor: platform === "ios" ? "#be1522" : "#fff",