This commit is contained in:
Zhiyuan Zheng 2022-06-21 23:50:49 +02:00
parent 29977b6c9e
commit 0f8befc89c
1 changed files with 3 additions and 7 deletions

View File

@ -1,9 +1,8 @@
import Button from '@components/Button' import Button from '@components/Button'
import { useAccessibility } from '@utils/accessibility/AccessibilityManager' import GracefullyImage from '@components/GracefullyImage'
import { useTheme } from '@utils/styles/ThemeManager' import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react' import React from 'react'
import { Dimensions, View } from 'react-native' import { Dimensions, View } from 'react-native'
import FastImage from 'react-native-fast-image'
import { useSafeAreaInsets } from 'react-native-safe-area-context' import { useSafeAreaInsets } from 'react-native-safe-area-context'
export interface Props { export interface Props {
@ -13,16 +12,13 @@ export interface Props {
const AccountHeader = React.memo( const AccountHeader = React.memo(
({ account, edit }: Props) => { ({ account, edit }: Props) => {
const { reduceMotionEnabled } = useAccessibility()
const { colors } = useTheme() const { colors } = useTheme()
const topInset = useSafeAreaInsets().top const topInset = useSafeAreaInsets().top
return ( return (
<View> <View>
<FastImage <GracefullyImage
source={{ uri={{ original: account?.header, static: account?.header_static }}
uri: reduceMotionEnabled ? account?.header_static : account?.header
}}
style={{ style={{
height: Dimensions.get('screen').width / 3 + topInset, height: Dimensions.get('screen').width / 3 + topInset,
backgroundColor: colors.disabled backgroundColor: colors.disabled