Skip to content

Commit 959f5b2

Browse files
committed
fix(app): tune home composer scrims
1 parent 8775938 commit 959f5b2

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

packages/happy-app/sources/components/HomeDock.tsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22
import { ActivityIndicator, Keyboard, LayoutChangeEvent, Modal as RNModal, Platform, Pressable, ScrollView, Text, TextInput, View } from 'react-native';
33
import { Ionicons } from '@expo/vector-icons';
4+
import { BlurView } from 'expo-blur';
45
import { useSafeAreaInsets } from 'react-native-safe-area-context';
56
import { StyleSheet, useUnistyles } from 'react-native-unistyles';
67
import { useReanimatedKeyboardAnimation } from 'react-native-keyboard-controller';
@@ -90,20 +91,23 @@ const MOBILE_ACTION_ROW_GEOMETRY = resolveMobileComposerActionRowGeometry();
9091
const MOBILE_ICON_ACTION_GEOMETRY = resolveMobileComposerActionGeometry('icon');
9192
const MOBILE_PRIMARY_ACTION_GEOMETRY = resolveMobileComposerActionGeometry('primary');
9293
const MOBILE_COLLAPSED_COMPOSER_GEOMETRY = resolveMobileCollapsedComposerGeometry();
94+
const MOBILE_HOME_DOCK_TOP_PADDING = 8;
9395

9496
const styles = StyleSheet.create((theme) => ({
9597
keyboardFollower: {
9698
width: '100%',
9799
},
98-
// Reaches above the dock so the scrim's ramp lands on content rather than
99-
// on the composer itself.
100+
// Keep the content clear until the composer's midpoint. From there the
101+
// bottom scrim begins feathering over content that scrolls beneath it;
102+
// above that point the composer shadow provides the only separation.
100103
bottomBackdrop: {
101104
...StyleSheet.absoluteFillObject,
102-
top: -26,
105+
top: MOBILE_HOME_DOCK_TOP_PADDING
106+
+ MOBILE_COLLAPSED_COMPOSER_GEOMETRY.shellHeight / 2,
103107
},
104108
safeArea: {
105109
paddingHorizontal: 16,
106-
paddingTop: 8,
110+
paddingTop: MOBILE_HOME_DOCK_TOP_PADDING,
107111
},
108112
// The focused composer replaces the resting one rather than covering it:
109113
// the modal sits a safe-area inset higher, so leaving this on screen showed
@@ -296,7 +300,7 @@ const styles = StyleSheet.create((theme) => ({
296300
right: 0,
297301
bottom: 0,
298302
},
299-
focusBackdrop: {
303+
focusBackdropDim: {
300304
backgroundColor: theme.dark ? 'rgba(0, 0, 0, 0.88)' : 'rgba(255, 255, 255, 0.88)',
301305
},
302306
focusDock: {
@@ -1586,8 +1590,20 @@ export const HomeDock = React.memo(({
15861590
<View style={styles.modalRoot}>
15871591
<Animated.View
15881592
pointerEvents="box-none"
1589-
style={[styles.modalBackdrop, styles.focusBackdrop, focusBackdropStyle]}
1593+
style={[styles.modalBackdrop, focusBackdropStyle]}
15901594
>
1595+
<BlurView
1596+
blurMethod={Platform.OS === 'android' ? 'dimezisBlurViewSdk31Plus' : undefined}
1597+
blurReductionFactor={2}
1598+
intensity={8}
1599+
pointerEvents="none"
1600+
tint={theme.dark ? 'systemUltraThinMaterialDark' : 'systemUltraThinMaterialLight'}
1601+
style={styles.modalBackdrop}
1602+
/>
1603+
<View
1604+
pointerEvents="none"
1605+
style={[styles.modalBackdrop, styles.focusBackdropDim]}
1606+
/>
15911607
<Pressable
15921608
style={styles.modalBackdrop}
15931609
onPress={handleFocusBackdropPress}

0 commit comments

Comments
 (0)