about summary refs log tree commit diff
path: root/src/view/shell/bottom-bar
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2023-11-09 20:15:05 +0000
committerGitHub <noreply@github.com>2023-11-09 12:15:05 -0800
commit7a55ca613347680cd94add01faa5dc3f216b9bd2 (patch)
treed9fa7951b43a8148b44e12a93452e214e1c4a798 /src/view/shell/bottom-bar
parent1dcf882619bc2d6b3eefebf83e76f4b21871b791 (diff)
downloadvoidsky-7a55ca613347680cd94add01faa5dc3f216b9bd2.tar.zst
Sync top/bottom bar disappearance to the scroll (#1855)
* Disable existing code that toggles shell

* Make shell mode a float

* Translate based on the gesture

* Track header and footer heights

* Add web support

* Fix types and cleanup

* Add back isScrolled logic

* Add comments
Diffstat (limited to 'src/view/shell/bottom-bar')
-rw-r--r--src/view/shell/bottom-bar/BottomBar.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx
index 69a7c4c0e..3dd7f57c5 100644
--- a/src/view/shell/bottom-bar/BottomBar.tsx
+++ b/src/view/shell/bottom-bar/BottomBar.tsx
@@ -27,6 +27,7 @@ import {UserAvatar} from 'view/com/util/UserAvatar'
 import {useLingui} from '@lingui/react'
 import {msg} from '@lingui/macro'
 import {useModalControls} from '#/state/modals'
+import {useShellLayout} from '#/state/shell/shell-layout'
 
 type TabOptions = 'Home' | 'Search' | 'Notifications' | 'MyProfile' | 'Feeds'
 
@@ -39,6 +40,7 @@ export const BottomBar = observer(function BottomBarImpl({
   const {_} = useLingui()
   const safeAreaInsets = useSafeAreaInsets()
   const {track} = useAnalytics()
+  const {footerHeight} = useShellLayout()
   const {isAtHome, isAtSearch, isAtFeeds, isAtNotifications, isAtMyProfile} =
     useNavigationTabState()
 
@@ -88,7 +90,10 @@ export const BottomBar = observer(function BottomBarImpl({
         pal.border,
         {paddingBottom: clamp(safeAreaInsets.bottom, 15, 30)},
         footerMinimalShellTransform,
-      ]}>
+      ]}
+      onLayout={e => {
+        footerHeight.value = e.nativeEvent.layout.height
+      }}>
       <Btn
         testID="bottomBarHomeBtn"
         icon={