Skip to content

Commit a2018a1

Browse files
authored
[codex] Fix Android profile header dimming (#14341)
1 parent 28293fd commit a2018a1

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

packages/mobile/src/screens/profile-screen/ProfileNavOverlay.tsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useCurrentUserId, useProfileUser } from '@audius/common/api'
44
import { ShareSource } from '@audius/common/models'
55
import { modalsActions, shareModalUIActions } from '@audius/common/store'
66
import { BlurView } from '@react-native-community/blur'
7-
import { StyleSheet, View } from 'react-native'
7+
import { Platform, StyleSheet, View } from 'react-native'
88
import Animated, {
99
interpolate,
1010
useAnimatedStyle
@@ -22,7 +22,7 @@ import {
2222
import { UserLink } from 'app/components/user-link'
2323
import { useNavigation } from 'app/hooks/useNavigation'
2424
import { makeStyles } from 'app/styles'
25-
import { isDarkTheme, useThemeVariant } from 'app/utils/theme'
25+
import { isDarkTheme, useThemeColors, useThemeVariant } from 'app/utils/theme'
2626

2727
import { useProfileScrollY } from './ProfileScrollContext'
2828

@@ -83,6 +83,7 @@ export const ProfileNavOverlay = () => {
8383
const navigation = useNavigation()
8484
const scrollY = useProfileScrollY()
8585
const isDarkMode = isDarkTheme(useThemeVariant())
86+
const { backgroundSurface } = useThemeColors()
8687

8788
const { data: accountId } = useCurrentUserId()
8889
const { user_id } =
@@ -167,11 +168,21 @@ export const ProfileNavOverlay = () => {
167168
pointerEvents='box-none'
168169
style={[styles.root, { height: overlayHeight }]}
169170
>
170-
<AnimatedBlurView
171-
blurType={isDarkMode ? 'dark' : 'light'}
172-
blurAmount={20}
173-
style={[styles.blurBackground, blurBackgroundStyle]}
174-
/>
171+
{Platform.OS === 'android' ? (
172+
<Animated.View
173+
style={[
174+
styles.blurBackground,
175+
{ backgroundColor: backgroundSurface },
176+
blurBackgroundStyle
177+
]}
178+
/>
179+
) : (
180+
<AnimatedBlurView
181+
blurType={isDarkMode ? 'dark' : 'light'}
182+
blurAmount={20}
183+
style={[styles.blurBackground, blurBackgroundStyle]}
184+
/>
185+
)}
175186
<Flex
176187
direction='row'
177188
justifyContent='space-between'

0 commit comments

Comments
 (0)