Skip to content

Commit 15938fd

Browse files
committed
iPhones without notch design problem is fixed. Also better style coding
1 parent f66de72 commit 15938fd

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

lib/src/HeaderClassicSearchBar/HeaderClassicSearchBar.style.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { Platform } from "react-native";
12
import {
2-
hasNotch,
33
getStatusBarHeight,
4+
isIPhoneXFamily,
45
isAndroid
56
} from "@freakycoder/react-native-helpers";
67

@@ -22,19 +23,22 @@ export const container = (backgroundColor, insets) => {
2223
backgroundColor,
2324
borderBottomEndRadius: 24,
2425
borderBottomStartRadius: 24,
25-
height: isAndroid ? insets.top + 70 : 115
26+
height: isAndroid ? insets.top + 70 : isIPhoneXFamily() ? 115 : 80
2627
};
2728
};
2829

2930
export const searchboxContainer = insets => ({
3031
flexDirection: "row",
3132
alignItems: "center",
3233
justifyContent: "space-around",
33-
marginTop: hasNotch()
34-
? getStatusBarHeight() + 16
35-
: isAndroid
36-
? insets.top + 16
37-
: 0
34+
...Platform.select({
35+
ios: {
36+
marginTop: isIPhoneXFamily() ? getStatusBarHeight() + 16 : 30
37+
},
38+
android: {
39+
marginTop: insets.top + 16
40+
}
41+
})
3842
});
3943

4044
export default {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-header-search-bar",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "Fully customizable header search bar for React Native",
55
"keywords": [
66
"header",

0 commit comments

Comments
 (0)