aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/ProfilePreview.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-05-04 13:31:17 -0400
committerGitHub <noreply@github.com>2021-05-04 13:31:17 -0400
commit1441ef007549f24a292317f1e67c0de63cacbd2b (patch)
tree1b1fe4a21f257c468c321d49804f124c98a6e6b6 /src/components/profile/ProfilePreview.tsx
parent5a8d92bcd869ada1079bc36b6598c899a8a9246d (diff)
parent64dedc2bc0c65fae604ba771ae4c17d1927ff1c2 (diff)
Merge pull request #392 from IvanIFChen/tma791-remove-profile-photo-requirement
[TMA-791] Removed profile photo requirement
Diffstat (limited to 'src/components/profile/ProfilePreview.tsx')
-rw-r--r--src/components/profile/ProfilePreview.tsx13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/components/profile/ProfilePreview.tsx b/src/components/profile/ProfilePreview.tsx
index bea989d9..66d68d8f 100644
--- a/src/components/profile/ProfilePreview.tsx
+++ b/src/components/profile/ProfilePreview.tsx
@@ -2,7 +2,6 @@ import {useNavigation} from '@react-navigation/native';
import React, {useEffect, useState} from 'react';
import {
Alert,
- Image,
StyleSheet,
Text,
TouchableOpacity,
@@ -23,6 +22,7 @@ import {
userXInStore,
} from '../../utils';
import {addUserToRecentlySearched} from '../../utils/search';
+import {Avatar} from '../common';
/**
* This component returns user's profile picture friended by username as a touchable component.
@@ -48,7 +48,7 @@ const ProfilePreview: React.FC<ProfilePreviewProps> = ({
}) => {
const navigation = useNavigation();
const {user: loggedInUser} = useSelector((state: RootState) => state.user);
- const [avatar, setAvatar] = useState<string | null>(null);
+ const [avatar, setAvatar] = useState<string>();
const dispatch = useDispatch();
useEffect(() => {
@@ -187,14 +187,7 @@ const ProfilePreview: React.FC<ProfilePreviewProps> = ({
<TouchableOpacity
onPress={addToRecentlyStoredAndNavigateToProfile}
style={containerStyle}>
- <Image
- style={avatarStyle}
- source={
- avatar
- ? {uri: avatar}
- : require('../../assets/images/avatar-placeholder.png')
- }
- />
+ <Avatar style={avatarStyle} uri={avatar} />
<View style={nameContainerStyle}>
{(previewType === 'Search' || previewType === 'Recent') && (
<>