diff options
author | Hailey <me@haileyok.com> | 2024-04-11 15:20:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-11 15:20:26 -0700 |
commit | 740cd029d7162a936d16b427201eb8972e365b94 (patch) | |
tree | ff4cf80cc8cd88bd958abd68c3cb3aa46328240e /src/view/shell/bottom-bar | |
parent | 9007810cdb5ffc8fbdf8e2a2af6c073b76b318f3 (diff) | |
download | voidsky-740cd029d7162a936d16b427201eb8972e365b94.tar.zst |
Improve Android haptic, offer toggle for haptics in the app (#3482)
* improve android haptics, offer toggle for haptics * update haptics.ts * default to false * simplify to `playHaptic` * just leave them as `feedInfo` * use a hook for `playHaptic` * missed one of them
Diffstat (limited to 'src/view/shell/bottom-bar')
-rw-r--r-- | src/view/shell/bottom-bar/BottomBar.tsx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx index f41631a96..c35fa106d 100644 --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -8,7 +8,7 @@ import {BottomTabBarProps} from '@react-navigation/bottom-tabs' import {StackActions} from '@react-navigation/native' import {useAnalytics} from '#/lib/analytics/analytics' -import {Haptics} from '#/lib/haptics' +import {useHaptics} from '#/lib/haptics' import {useDedupe} from '#/lib/hooks/useDedupe' import {useMinimalShellMode} from '#/lib/hooks/useMinimalShellMode' import {useNavigationTabState} from '#/lib/hooks/useNavigationTabState' @@ -59,6 +59,7 @@ export function BottomBar({navigation}: BottomTabBarProps) { const closeAllActiveElements = useCloseAllActiveElements() const dedupe = useDedupe() const accountSwitchControl = useDialogControl() + const playHaptic = useHaptics() const showSignIn = React.useCallback(() => { closeAllActiveElements() @@ -104,9 +105,9 @@ export function BottomBar({navigation}: BottomTabBarProps) { }, [onPressTab]) const onLongPressProfile = React.useCallback(() => { - Haptics.default() + playHaptic() accountSwitchControl.open() - }, [accountSwitchControl]) + }, [accountSwitchControl, playHaptic]) return ( <> |