From 0bbe2c5e32f72e4aaf52d7e1f72b6076517caee7 Mon Sep 17 00:00:00 2001 From: Hailey Date: Sun, 4 Feb 2024 12:54:07 -0800 Subject: show bottom bar on web tablet breakpoints when logged out (signup cta) (#2747) * show signup bottom bar on web tablet * show signup bottom bar on web tablet * comment * adjust load latest btn position based on logged in/out --- src/view/com/util/load-latest/LoadLatestBtn.tsx | 10 ++++++++-- src/view/shell/createNativeStackNavigatorWithAuth.tsx | 10 +++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/view/com/util/load-latest/LoadLatestBtn.tsx b/src/view/com/util/load-latest/LoadLatestBtn.tsx index 970d3a73a..5fad11760 100644 --- a/src/view/com/util/load-latest/LoadLatestBtn.tsx +++ b/src/view/com/util/load-latest/LoadLatestBtn.tsx @@ -10,6 +10,7 @@ import Animated from 'react-native-reanimated' const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity) import {isWeb} from 'platform/detection' +import {useSession} from 'state/session' export function LoadLatestBtn({ onPress, @@ -21,9 +22,14 @@ export function LoadLatestBtn({ showIndicator: boolean }) { const pal = usePalette('default') - const {isDesktop, isTablet, isMobile} = useWebMediaQueries() + const {hasSession} = useSession() + const {isDesktop, isTablet, isMobile, isTabletOrMobile} = useWebMediaQueries() const {fabMinimalShellTransform} = useMinimalShellMode() + // Adjust height of the fab if we have a session only on mobile web. If we don't have a session, we want to adjust + // it on both tablet and mobile since we are showing the bottom bar (see createNativeStackNavigatorWithAuth) + const showBottomBar = hasSession ? isMobile : isTabletOrMobile + return ( } @@ -134,6 +134,10 @@ function NativeStackNavigator({ } } + // Show the bottom bar if we have a session only on mobile web. If we don't have a session, we want to show it + // on both tablet and mobile web so that we see the sign up CTA. + const showBottomBar = hasSession ? isMobile : isTabletOrMobile + return ( - {isWeb && isMobile && } - {isWeb && !isMobile && ( + {isWeb && showBottomBar && } + {isWeb && !showBottomBar && ( <> -- cgit 1.4.1