feat: load default profile image if user profile photo is not set
This commit is contained in:
parent
b54c83a2ce
commit
f92c8c527d
1 changed files with 9 additions and 2 deletions
|
|
@ -3,16 +3,23 @@ import { LogOut } from 'lucide-react-native';
|
|||
|
||||
import { UserPhoto } from './UserPhoto';
|
||||
|
||||
import defaultAvatar from '@assets/userPhotoDefault.png';
|
||||
|
||||
import { useAuth } from '@hooks/useAuth';
|
||||
|
||||
export function HomeHeader() {
|
||||
const {
|
||||
user: { name },
|
||||
user: { name, avatar },
|
||||
} = useAuth();
|
||||
|
||||
return (
|
||||
<HStack bg="$gray600" pt="$16" pb="$5" px="$8" alignItems="center" gap="$4">
|
||||
<UserPhoto source={{ uri: 'https://i.pravatar.cc/200' }} alt="avatar image" h="$16" w="$16" />
|
||||
<UserPhoto
|
||||
source={avatar ? { uri: avatar } : defaultAvatar}
|
||||
alt="avatar image"
|
||||
h="$16"
|
||||
w="$16"
|
||||
/>
|
||||
|
||||
<VStack flex={1}>
|
||||
<Text color="$gray100" fontSize="$sm">
|
||||
|
|
|
|||
Loading…
Reference in a new issue