From e33568737bd1f0409a7ae54f1d6c8aadea82739d Mon Sep 17 00:00:00 2001 From: Dongmin Kim Date: Wed, 22 May 2019 19:54:09 +0900 Subject: [PATCH 1/2] NavigationBar fix for iPhone X, Xs Max, XR --- components/NavigationBar/NavigationBar.js | 5 +---- const.js | 3 ++- theme.js | 12 +++++------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/components/NavigationBar/NavigationBar.js b/components/NavigationBar/NavigationBar.js index eca7ca7a..5d583b8c 100644 --- a/components/NavigationBar/NavigationBar.js +++ b/components/NavigationBar/NavigationBar.js @@ -76,10 +76,7 @@ class NavigationBar extends PureComponent { renderStatusBar() { const { style } = this.props; - return Device.select({ - iPhoneX: (), - default: null, - }); + return (); } render() { diff --git a/const.js b/const.js index 92d289e0..92e1cb43 100644 --- a/const.js +++ b/const.js @@ -1,4 +1,4 @@ -export const NAVIGATION_HEADER_HEIGHT = 64; +export const NAVIGATION_HEADER_HEIGHT = 44; export const IPHONE_X_NOTCH_PADDING = 30; export const IPHONE_X_HOME_INDICATOR_PADDING = 34; @@ -6,3 +6,4 @@ export const IPHONE_X_LONG_SIDE = 812; export const IPHONE_XR_NOTCH_PADDING = 34; export const IPHONE_XR_LONG_SIDE = 896; + diff --git a/theme.js b/theme.js index 6b709269..e5b31378 100644 --- a/theme.js +++ b/theme.js @@ -28,9 +28,9 @@ const window = Dimensions.get('window'); const STATUS_BAR_OFFSET = (Platform.OS === 'android' ? -StatusBar.currentConfig : 0); const NAVIGATION_BAR_HEIGHT = Device.select({ - iPhoneX: NAVIGATION_HEADER_HEIGHT + IPHONE_X_NOTCH_PADDING, - iPhoneXR: NAVIGATION_HEADER_HEIGHT + IPHONE_XR_NOTCH_PADDING, - default: NAVIGATION_HEADER_HEIGHT, + iPhoneX: NAVIGATION_HEADER_HEIGHT + IPHONE_X_NOTCH_PADDING + 14, + iPhoneXR: NAVIGATION_HEADER_HEIGHT + IPHONE_XR_NOTCH_PADDING + 14, + default: NAVIGATION_HEADER_HEIGHT + 20, }); export const sizeVariants = ['', 'left', 'right', 'top', 'bottom', 'horizontal', 'vertical']; @@ -1433,12 +1433,10 @@ export default (variables = defaultThemeVariables) => ({ }, container: { [INCLUDE]: ['fillParent'], - height: NAVIGATION_HEADER_HEIGHT, + height: NAVIGATION_BAR_HEIGHT, backgroundColor: variables.navBarBackground, borderBottomColor: variables.navBarBorderColor, borderBottomWidth: StyleSheet.hairlineWidth, - // Leave space for the status bar on iOS - paddingTop: Platform.OS === 'ios' ? 20 : 0, }, componentsContainer: { @@ -1583,7 +1581,7 @@ export default (variables = defaultThemeVariables) => ({ }), flex: 1, flexGrow: 1, - height: NAVIGATION_HEADER_HEIGHT, + height: NAVIGATION_BAR_HEIGHT, left: 0, solidifyAnimation(driver) { return { From c87ba00b1fbb5029aa54c8d5fc9c3e2052458a66 Mon Sep 17 00:00:00 2001 From: Dongmin Kim Date: Mon, 11 Nov 2019 19:31:17 +0900 Subject: [PATCH 2/2] Fix for iPhone 8 after merging branches --- theme.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/theme.js b/theme.js index 16e52496..e5b31378 100644 --- a/theme.js +++ b/theme.js @@ -1437,18 +1437,6 @@ export default (variables = defaultThemeVariables) => ({ backgroundColor: variables.navBarBackground, borderBottomColor: variables.navBarBorderColor, borderBottomWidth: StyleSheet.hairlineWidth, - - // Leave space for the status bar on iOS - paddingTop: Device.select({ - iPhoneX: 0, - iPhoneXR: 0, - default: ( - Platform.OS === 'ios' - && !Device.isIphoneX - && !Device.isIphoneXR - ? 20 : 0 - ), - }), }, componentsContainer: {