aboutsummaryrefslogtreecommitdiff
path: root/src/components/common/Avatar.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-27 10:46:17 -0400
committerIvan Chen <ivan@tagg.id>2021-04-27 10:46:17 -0400
commita13dcb5110245bb554d79e779c4942e6f5aaf18a (patch)
treebb8e5bebe2cf5677d0ffc9b72819a56c9d309cbf /src/components/common/Avatar.tsx
parentcaac607ed90c35ad8d4b2787b170e1fd1f165333 (diff)
refactored avatar
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;