From f6769b283fe83d7abbc0545077b3dca978184eed Mon Sep 17 00:00:00 2001 From: John Fawcett Date: Wed, 12 Apr 2023 20:27:55 -0500 Subject: Mobile Web (#427) * WIP * WIP * Fix header offset on web * Remove debug * Fix web mobile feed and FAB layout * Fix modals on mobile web * Remove dead code * Remove ios config that shouldnt be committed now * Move bottom bar into its own folder * Fix web drawer navigation and state behaviors * Remove dark mode toggle from web drawer for now * Fix search on mobile web * Fix the logged out splash screen on mobile web * Fixes to detox simulator --------- Co-authored-by: Paul Frazee --- src/lib/hooks/useNavigationTabState.web.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/lib/hooks/useNavigationTabState.web.ts (limited to 'src/lib/hooks/useNavigationTabState.web.ts') diff --git a/src/lib/hooks/useNavigationTabState.web.ts b/src/lib/hooks/useNavigationTabState.web.ts new file mode 100644 index 000000000..d0173aa0f --- /dev/null +++ b/src/lib/hooks/useNavigationTabState.web.ts @@ -0,0 +1,13 @@ +import {useNavigationState} from '@react-navigation/native' +import {getCurrentRoute} from 'lib/routes/helpers' + +export function useNavigationTabState() { + return useNavigationState(state => { + let currentRoute = state ? getCurrentRoute(state).name : 'Home' + return { + isAtHome: currentRoute === 'Home', + isAtSearch: currentRoute === 'Search', + isAtNotifications: currentRoute === 'Notifications', + } + }) +} -- cgit 1.4.1