From 4987c2e588a2cac77117e0e53b138a340d585280 Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Wed, 6 May 2020 10:05:35 -0700 Subject: [PATCH] Change header hiding logic --- website/App.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/website/App.js b/website/App.js index 101c434..2fc3aa4 100644 --- a/website/App.js +++ b/website/App.js @@ -24,12 +24,19 @@ const linking = { const BrowsingStack = createStackNavigator(); -function Browsing() { - // This is a lil jank, semi-randomly switches header mode if you resize and navigate - const skipHeader = Dimensions.get('window').width <= 900; +const IsPwa = !!["fullscreen", "standalone", "minimal-ui"].some((displayMode) => + window.matchMedia("(display-mode: " + displayMode + ")") +).matches; +const IsSmallScreen = Dimensions.get("window").width <= 900; +const ShowHeader = IsPwa || !IsSmallScreen; + +function Browsing() { return ( - +