From 41cb7165dd5fe1b6caf59cd83e93a905d3576ddf Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Fri, 21 Sep 2018 13:55:06 +0200 Subject: [PATCH] fix: StatusBar.currentHeight is Android-only --- src/components/Appbar/AppbarHeader.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/Appbar/AppbarHeader.js b/src/components/Appbar/AppbarHeader.js index 278415f..89926bb 100644 --- a/src/components/Appbar/AppbarHeader.js +++ b/src/components/Appbar/AppbarHeader.js @@ -20,9 +20,9 @@ type Props = { dark?: boolean, /** * Extra padding to add at the top of header to account for translucent status bar. - * This is automatically handled on iOS including iPhone X. - * If you are using Android and use Expo, we assume translucent status bar and set a height for status bar automatically. - * Pass `0` or a custom value to disable the default behaviour. + * This is automatically handled on iOS >= 11 including iPhone X using `SafeAreaView`. + * If you are using Expo, we assume translucent status bar and set a height for status bar automatically. + * Pass `0` or a custom value to disable the default behaviour, and customize the height. */ statusBarHeight?: number, /** @@ -44,9 +44,7 @@ const DEFAULT_STATUSBAR_HEIGHT = Platform.select({ android: DEFAULT_STATUSBAR_HEIGHT_EXPO, ios: Platform.Version < 11 - ? DEFAULT_STATUSBAR_HEIGHT_EXPO === undefined - ? StatusBar.currentHeight - : DEFAULT_STATUSBAR_HEIGHT_EXPO + ? DEFAULT_STATUSBAR_HEIGHT_EXPO : undefined, });