Fixing padding of searchbar in search screen (#4236)

Co-authored-by: avasconcelos114 <andre.onogoro@gmail.com>
This commit is contained in:
Mattermost Build 2020-04-27 17:29:58 +02:00 committed by GitHub
parent e84f7196a0
commit 1c92529958
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -704,6 +704,17 @@ export default class Search extends PureComponent {
fontSize: 15,
};
const paddingRes = padding(isLandscape);
if (paddingRes) {
// Without this the default paddingLeft in style.header
// overrides the paddingHorizontal value gotten from padding(isLandscape)
paddingRes.paddingLeft = null;
if (isLandscape) {
paddingRes.paddingTop = 10;
}
}
return (
<SafeAreaView
excludeHeader={isLandscape && DeviceTypes.IS_IPHONE_WITH_INSETS}
@ -711,7 +722,7 @@ export default class Search extends PureComponent {
>
<KeyboardLayout>
<StatusBar/>
<View style={[style.header, padding(isLandscape)]}>
<View style={[style.header, paddingRes]}>
<SearchBar
ref={this.setSearchBarRef}
placeholder={intl.formatMessage({id: 'search_bar.search', defaultMessage: 'Search'})}