aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Cover.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-12-14 16:02:09 -0800
committerGitHub <noreply@github.com>2020-12-14 19:02:09 -0500
commit3b7bf256d83e1898642c2aab9072ffbeec8cc032 (patch)
tree9b48ff57f61414321e2c78124bd6a63101a04602 /src/components/profile/Cover.tsx
parent410d9224f4e198ab0b8ecae35fa05c240a2439bf (diff)
[TMA - 426] Fix recent search + Add refresh control (#138)
* Got rid of small lint errors before start * Final push * Final * disable scroll first try / logic * small change * Try to make the cover photo consistent with different screen sizes * Final change * added RefreshControl * removed scale effect * Fix misorientation of cover * remove more scale stuff * fix userIDs for different views * Mend refresh control * white bg Co-authored-by: hsalhab <husam_salhab@brown.edu>
Diffstat (limited to 'src/components/profile/Cover.tsx')
-rw-r--r--src/components/profile/Cover.tsx25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/components/profile/Cover.tsx b/src/components/profile/Cover.tsx
index 3c0f7045..a03ef123 100644
--- a/src/components/profile/Cover.tsx
+++ b/src/components/profile/Cover.tsx
@@ -1,30 +1,21 @@
-import React, {useContext} from 'react';
-import {Image, StyleSheet} from 'react-native';
-import Animated from 'react-native-reanimated';
+import React from 'react';
+import {Image, StyleSheet, View} from 'react-native';
import {IMAGE_WIDTH, COVER_HEIGHT, IMAGE_HEIGHT} from '../../constants';
-import {useSelector, useStore} from 'react-redux';
+import {useSelector} from 'react-redux';
import {RootState} from '../../store/rootreducer';
import {ScreenType} from '../../types';
-import {DUMMY_USERID, NO_USER_DATA} from '../../store/initialStates';
-const {interpolate, Extrapolate} = Animated;
interface CoverProps {
- y: Animated.Value<number>;
- userXId: string;
+ userXId: string | undefined;
screenType: ScreenType;
}
-const Cover: React.FC<CoverProps> = ({y, userXId, screenType}) => {
+const Cover: React.FC<CoverProps> = ({userXId, screenType}) => {
const {cover = ''} = userXId
? useSelector((state: RootState) => state.userX[screenType][userXId])
: useSelector((state: RootState) => state.user);
- const scale: Animated.Node<number> = interpolate(y, {
- inputRange: [-COVER_HEIGHT, 0],
- outputRange: [1.5, 1.25],
- extrapolateRight: Extrapolate.CLAMP,
- });
return (
- <Animated.View style={[styles.container, {transform: [{scale}]}]}>
+ <View style={[styles.container]}>
<Image
style={styles.image}
source={
@@ -33,7 +24,7 @@ const Cover: React.FC<CoverProps> = ({y, userXId, screenType}) => {
: require('../../assets/images/cover-placeholder.png')
}
/>
- </Animated.View>
+ </View>
);
};
@@ -43,7 +34,7 @@ const styles = StyleSheet.create({
},
image: {
width: IMAGE_WIDTH,
- height: IMAGE_HEIGHT,
+ height: COVER_HEIGHT,
},
});
export default Cover;