diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-27 10:46:17 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-04-27 10:46:17 -0400 |
commit | a13dcb5110245bb554d79e779c4942e6f5aaf18a (patch) | |
tree | bb8e5bebe2cf5677d0ffc9b72819a56c9d309cbf /src/components/common/AvatarTitle.tsx | |
parent | caac607ed90c35ad8d4b2787b170e1fd1f165333 (diff) |
refactored avatar
Diffstat (limited to 'src/components/common/AvatarTitle.tsx')
-rw-r--r-- | src/components/common/AvatarTitle.tsx | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/components/common/AvatarTitle.tsx b/src/components/common/AvatarTitle.tsx index 81351327..a2a7c0aa 100644 --- a/src/components/common/AvatarTitle.tsx +++ b/src/components/common/AvatarTitle.tsx @@ -1,10 +1,11 @@ import React from 'react'; -import {Image, StyleSheet, View} from 'react-native'; +import {StyleSheet, View} from 'react-native'; import LinearGradient from 'react-native-linear-gradient'; import {TAGGS_GRADIENT} from '../../constants'; +import Avatar from './Avatar'; type AvatarTitleProps = { - avatar: string | null; + avatar: string | undefined; }; const AvatarTitle: React.FC<AvatarTitleProps> = ({avatar}) => { return ( @@ -16,14 +17,7 @@ const AvatarTitle: React.FC<AvatarTitleProps> = ({avatar}) => { angleCenter={{x: 0.5, y: 0.5}} style={styles.gradient} /> - <Image - style={styles.avatar} - source={ - avatar - ? {uri: avatar} - : require('../../assets/images/avatar-placeholder.png') - } - /> + <Avatar style={styles.avatar} uri={avatar} /> </View> ); }; |