aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Cover.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/profile/Cover.tsx')
-rw-r--r--src/components/profile/Cover.tsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/profile/Cover.tsx b/src/components/profile/Cover.tsx
index 01199f06..37ecb9bd 100644
--- a/src/components/profile/Cover.tsx
+++ b/src/components/profile/Cover.tsx
@@ -2,14 +2,17 @@ import React from 'react';
import {Image, StyleSheet} from 'react-native';
import Animated from 'react-native-reanimated';
import {IMAGE_WIDTH, COVER_HEIGHT} from '../../constants';
-import {AuthContext} from '../../routes/authentication';
+import {AuthContext, ProfileContext} from '../../routes/';
const {interpolate, Extrapolate} = Animated;
interface CoverProps {
y: Animated.Value<number>;
+ isProfileView: boolean;
}
-const Cover: React.FC<CoverProps> = ({y}) => {
- const {cover} = React.useContext(AuthContext);
+const Cover: React.FC<CoverProps> = ({y, isProfileView}) => {
+ const {cover} = isProfileView
+ ? React.useContext(ProfileContext)
+ : React.useContext(AuthContext);
const scale: Animated.Node<number> = interpolate(y, {
inputRange: [-COVER_HEIGHT, 0],
outputRange: [1.5, 1.25],