aboutsummaryrefslogtreecommitdiff
path: root/src/components/common/Avatar.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-05-07 16:01:47 -0400
committerIvan Chen <ivan@tagg.id>2021-05-07 16:01:47 -0400
commit76bc8c5825f39257be6e7648d12b858f1e805569 (patch)
treeb94d9570439ebfa42e6664144f124abe5d4113e3 /src/components/common/Avatar.tsx
parent65c7411f4609edac3d4d5f23fc031ed274fc5872 (diff)
parentc9d32e68fbb9d1bc175722bfda49454a6f627eae (diff)
Merge branch 'master' into tma821-load-badges-faster-ft
# Conflicts: # src/utils/users.ts
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;