aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Avatar.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/profile/Avatar.tsx')
-rw-r--r--src/components/profile/Avatar.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/profile/Avatar.tsx b/src/components/profile/Avatar.tsx
index a0f7596c..aca3bf4d 100644
--- a/src/components/profile/Avatar.tsx
+++ b/src/components/profile/Avatar.tsx
@@ -1,13 +1,16 @@
import React from 'react';
import {Image, StyleSheet} from 'react-native';
-import {AuthContext} from '../../routes/authentication';
+import {AuthContext, ProfileContext} from '../../routes/';
const PROFILE_DIM = 100;
interface AvatarProps {
style: object;
+ isProfileView: boolean;
}
-const Avatar: React.FC<AvatarProps> = ({style}) => {
- const {avatar} = React.useContext(AuthContext);
+const Avatar: React.FC<AvatarProps> = ({style, isProfileView}) => {
+ const {avatar} = isProfileView
+ ? React.useContext(ProfileContext)
+ : React.useContext(AuthContext);
return (
<Image
style={[styles.image, style]}