Blur effect on home screen (iOS 26) (#9935)

This commit is contained in:
Samuel Newman
2026-02-26 15:00:12 +00:00
committed by GitHub
parent 9b24d75c9c
commit 65c4b7833d
6 changed files with 49 additions and 14 deletions
+6 -1
View File
@@ -1,13 +1,18 @@
import {interpolate, useAnimatedStyle} from 'react-native-reanimated'
import {useSafeAreaInsets} from 'react-native-safe-area-context'
import {useMinimalShellMode} from '#/state/shell/minimal-mode'
import {useShellLayout} from '#/state/shell/shell-layout'
import {IS_LIQUID_GLASS} from '#/env'
// Keep these separated so that we only pay for useAnimatedStyle that gets used.
export function useMinimalShellHeaderTransform() {
const {headerMode} = useMinimalShellMode()
const {headerHeight} = useShellLayout()
const {top: topInset} = useSafeAreaInsets()
const headerPinnedHeight = IS_LIQUID_GLASS ? topInset : 0
const headerTransform = useAnimatedStyle(() => {
const headerModeValue = headerMode.get()
@@ -19,7 +24,7 @@ export function useMinimalShellHeaderTransform() {
translateY: interpolate(
headerModeValue,
[0, 1],
[0, -headerHeight.get()],
[0, headerPinnedHeight - headerHeight.get()],
),
},
],