diff options
author | dan <dan.abramov@gmail.com> | 2024-08-16 20:06:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-16 20:06:55 +0100 |
commit | 40ab67fc4b5632715f9f0a003bbd243aa81668f3 (patch) | |
tree | d93feb2c7288145d75480380ab3fe6f1018e8a37 /src/lib | |
parent | a5af24b53b6085cfb5547592c29155bc10e71f9e (diff) | |
download | voidsky-40ab67fc4b5632715f9f0a003bbd243aa81668f3.tar.zst |
[Experiment] Always show bottom bar (#4946)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/hooks/useMinimalShellTransform.ts | 18 | ||||
-rw-r--r-- | src/lib/statsig/gates.ts | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/hooks/useMinimalShellTransform.ts b/src/lib/hooks/useMinimalShellTransform.ts index 9875840d6..17fe058e9 100644 --- a/src/lib/hooks/useMinimalShellTransform.ts +++ b/src/lib/hooks/useMinimalShellTransform.ts @@ -2,6 +2,7 @@ import {interpolate, useAnimatedStyle} from 'react-native-reanimated' import {useMinimalShellMode} from '#/state/shell/minimal-mode' import {useShellLayout} from '#/state/shell/shell-layout' +import {useGate} from '../statsig/statsig' // Keep these separated so that we only pay for useAnimatedStyle that gets used. @@ -27,8 +28,13 @@ export function useMinimalShellHeaderTransform() { export function useMinimalShellFooterTransform() { const mode = useMinimalShellMode() const {footerHeight} = useShellLayout() + const gate = useGate() + const isFixedBottomBar = gate('fixed_bottom_bar') const footerTransform = useAnimatedStyle(() => { + if (isFixedBottomBar) { + return {} + } return { pointerEvents: mode.value === 0 ? 'auto' : 'none', opacity: Math.pow(1 - mode.value, 2), @@ -39,13 +45,25 @@ export function useMinimalShellFooterTransform() { ], } }) + return footerTransform } export function useMinimalShellFabTransform() { const mode = useMinimalShellMode() + const gate = useGate() + const isFixedBottomBar = gate('fixed_bottom_bar') const fabTransform = useAnimatedStyle(() => { + if (isFixedBottomBar) { + return { + transform: [ + { + translateY: -44, + }, + ], + } + } return { transform: [ { diff --git a/src/lib/statsig/gates.ts b/src/lib/statsig/gates.ts index 492d09e95..0f92cd14a 100644 --- a/src/lib/statsig/gates.ts +++ b/src/lib/statsig/gates.ts @@ -1,6 +1,7 @@ export type Gate = // Keep this alphabetic please. | 'debug_show_feedcontext' + | 'fixed_bottom_bar' | 'new_user_guided_tour' | 'onboarding_minimum_interests' | 'show_follow_back_label_v2' |