Skip to content

Commit

Permalink
iPhones without notch design problem is fixed. Also better style coding
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathChaos committed Dec 12, 2019
1 parent f66de72 commit 15938fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions lib/src/HeaderClassicSearchBar/HeaderClassicSearchBar.style.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Platform } from "react-native";
import {
hasNotch,
getStatusBarHeight,
isIPhoneXFamily,
isAndroid
} from "@freakycoder/react-native-helpers";

Expand All @@ -22,19 +23,22 @@ export const container = (backgroundColor, insets) => {
backgroundColor,
borderBottomEndRadius: 24,
borderBottomStartRadius: 24,
height: isAndroid ? insets.top + 70 : 115
height: isAndroid ? insets.top + 70 : isIPhoneXFamily() ? 115 : 80
};
};

export const searchboxContainer = insets => ({
flexDirection: "row",
alignItems: "center",
justifyContent: "space-around",
marginTop: hasNotch()
? getStatusBarHeight() + 16
: isAndroid
? insets.top + 16
: 0
...Platform.select({
ios: {
marginTop: isIPhoneXFamily() ? getStatusBarHeight() + 16 : 30
},
android: {
marginTop: insets.top + 16
}
})
});

export default {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-header-search-bar",
"version": "0.1.4",
"version": "0.1.5",
"description": "Fully customizable header search bar for React Native",
"keywords": [
"header",
Expand Down

0 comments on commit 15938fd

Please sign in to comment.