diff options
author | Ashm Walia <40498934+ashmgarv@users.noreply.github.com> | 2020-10-18 16:37:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-18 19:37:32 -0400 |
commit | ab7fa09af967e0a8cf2ca53dfb24f8bc8a6886f7 (patch) | |
tree | 898e7aa42529eda91964ac1a18aa1881689554f2 /src/components/profile/Avatar.tsx | |
parent | 79d237f616c37940f5d476eb1dca6b5d05cf148a (diff) |
[TMA 279] Ability to search and view someone's profile (#58)
* Batch one : major changes
* WIP checkpoint
* The one before the final touch
* Probable final touch
* ran yarn lint D:
* linter broke something
* fixed a small bug
* Addressed a small nitpick
* Well abstracted now
Co-authored-by: Ivan Chen <ivan@thetaggid.com>
Diffstat (limited to 'src/components/profile/Avatar.tsx')
-rw-r--r-- | src/components/profile/Avatar.tsx | 9 |
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]} |