diff options
Diffstat (limited to 'src/components/profile/Cover.tsx')
-rw-r--r-- | src/components/profile/Cover.tsx | 25 |
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; |