Update appearance of new messages pill (#10442)
This commit is contained in:
@@ -7,7 +7,6 @@ import Animated, {
|
|||||||
withTiming,
|
withTiming,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {Trans} from '@lingui/react/macro'
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ScaleAndFadeIn,
|
ScaleAndFadeIn,
|
||||||
@@ -15,8 +14,8 @@ import {
|
|||||||
} from '#/lib/custom-animations/ScaleAndFade'
|
} from '#/lib/custom-animations/ScaleAndFade'
|
||||||
import {useHaptics} from '#/lib/haptics'
|
import {useHaptics} from '#/lib/haptics'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Text} from '#/components/Typography'
|
import {ArrowBottom_Stroke2_Corner0_Rounded as ArrowDownIcon} from '#/components/icons/Arrow'
|
||||||
import {IS_ANDROID, IS_IOS, IS_WEB} from '#/env'
|
import {IS_WEB} from '#/env'
|
||||||
|
|
||||||
const AnimatedPressable = Animated.createAnimatedComponent(Pressable)
|
const AnimatedPressable = Animated.createAnimatedComponent(Pressable)
|
||||||
|
|
||||||
@@ -28,8 +27,6 @@ export function NewMessagesPill({
|
|||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const playHaptic = useHaptics()
|
const playHaptic = useHaptics()
|
||||||
const {bottom: bottomInset} = useSafeAreaInsets()
|
const {bottom: bottomInset} = useSafeAreaInsets()
|
||||||
const bottomBarHeight = IS_IOS ? 42 : IS_ANDROID ? 60 : 0
|
|
||||||
const bottomOffset = IS_WEB ? 0 : bottomInset + bottomBarHeight
|
|
||||||
|
|
||||||
const scale = useSharedValue(1)
|
const scale = useSharedValue(1)
|
||||||
|
|
||||||
@@ -60,25 +57,24 @@ export function NewMessagesPill({
|
|||||||
a.z_10,
|
a.z_10,
|
||||||
a.align_center,
|
a.align_center,
|
||||||
{
|
{
|
||||||
bottom: bottomOffset + 70,
|
bottom: bottomInset + 70,
|
||||||
// Don't prevent scrolling in this area _except_ for in the pill itself
|
// Don't prevent scrolling in this area _except_ for in the pill itself
|
||||||
pointerEvents: 'box-none',
|
pointerEvents: 'box-none',
|
||||||
},
|
},
|
||||||
]}>
|
]}>
|
||||||
<AnimatedPressable
|
<AnimatedPressable
|
||||||
style={[
|
style={[
|
||||||
a.py_sm,
|
a.align_center,
|
||||||
|
a.justify_center,
|
||||||
a.rounded_full,
|
a.rounded_full,
|
||||||
a.shadow_sm,
|
a.shadow_sm,
|
||||||
a.border,
|
a.border,
|
||||||
t.atoms.bg_contrast_50,
|
t.atoms.bg,
|
||||||
t.atoms.border_contrast_medium,
|
t.atoms.border_contrast_low,
|
||||||
{
|
{
|
||||||
width: 160,
|
height: 40,
|
||||||
|
width: 40,
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
shadowOpacity: 0.125,
|
|
||||||
shadowRadius: 12,
|
|
||||||
shadowOffset: {width: 0, height: 5},
|
|
||||||
pointerEvents: 'box-only',
|
pointerEvents: 'box-only',
|
||||||
},
|
},
|
||||||
animatedStyle,
|
animatedStyle,
|
||||||
@@ -88,9 +84,7 @@ export function NewMessagesPill({
|
|||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
onPressIn={onPressIn}
|
onPressIn={onPressIn}
|
||||||
onPressOut={onPressOut}>
|
onPressOut={onPressOut}>
|
||||||
<Text style={[a.font_semi_bold]}>
|
<ArrowDownIcon size="md" style={[t.atoms.text]} />
|
||||||
<Trans>New messages</Trans>
|
|
||||||
</Text>
|
|
||||||
</AnimatedPressable>
|
</AnimatedPressable>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user