aboutsummaryrefslogtreecommitdiff
path: root/src/components/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/common')
-rw-r--r--src/components/common/AvatarTitle.tsx12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/components/common/AvatarTitle.tsx b/src/components/common/AvatarTitle.tsx
index 8c82dca9..e9998113 100644
--- a/src/components/common/AvatarTitle.tsx
+++ b/src/components/common/AvatarTitle.tsx
@@ -2,13 +2,19 @@ import React from 'react';
import {Image, StyleSheet} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import {AVATAR_DIM, AVATAR_GRADIENT_DIM, TAGGS_GRADIENT} from '../../constants';
-import {AuthContext} from '../../routes/authentication';
+import {AuthContext, ProfileContext} from '../../routes/';
/**
* An image component that returns the <Image> of the icon for a specific social media platform.
*/
-const AvatarTitle: React.FC = () => {
- const {avatar} = React.useContext(AuthContext);
+
+type AvatarTitleProps = {
+ isProfileView: boolean;
+};
+const AvatarTitle: React.FC<AvatarTitleProps> = ({isProfileView}) => {
+ const {avatar} = isProfileView
+ ? React.useContext(ProfileContext)
+ : React.useContext(AuthContext);
return (
<LinearGradient
colors={[TAGGS_GRADIENT.start, TAGGS_GRADIENT.end]}