aboutsummaryrefslogtreecommitdiff
path: root/src/components/common/Avatar.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/common/Avatar.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/common/Avatar.tsx')
-rw-r--r--src/components/common/Avatar.tsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/common/Avatar.tsx b/src/components/common/Avatar.tsx
new file mode 100644
index 00000000..831cf906
--- /dev/null
+++ b/src/components/common/Avatar.tsx
@@ -0,0 +1,18 @@
+import React, {FC} from 'react';
+import {Image, ImageStyle, StyleProp} from 'react-native';
+
+type AvatarProps = {
+ style: StyleProp<ImageStyle>;
+ uri: string | undefined;
+};
+const Avatar: FC<AvatarProps> = ({style, uri}) => {
+ return (
+ <Image
+ style={style}
+ defaultSource={require('../../assets/images/avatar-placeholder.png')}
+ source={{uri, cache: 'reload'}}
+ />
+ );
+};
+
+export default Avatar;