diff options
author | Ivan Chen <ivan@tagg.id> | 2021-03-26 15:33:37 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-03-26 15:33:37 -0400 |
commit | 9be7248ba54eeb2ad4d19edd4c01ee736b58bfcd (patch) | |
tree | 6f66b86bbe9adaffb7d866b22a89e0e3f78f26a3 /src/components/profile/Cover.tsx | |
parent | 883a6c51d4c3e442df5e6c0f3dc6fada2f370f8e (diff) | |
parent | 99de9c8402f470ead242a81510dc2764ae7d9e66 (diff) |
Merge branch 'master' into tma728-select-school-onboarding
# Conflicts:
# src/services/UserProfileService.ts
# src/types/types.ts
Diffstat (limited to 'src/components/profile/Cover.tsx')
-rw-r--r-- | src/components/profile/Cover.tsx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/components/profile/Cover.tsx b/src/components/profile/Cover.tsx index a03ef123..b7502cff 100644 --- a/src/components/profile/Cover.tsx +++ b/src/components/profile/Cover.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {Image, StyleSheet, View} from 'react-native'; -import {IMAGE_WIDTH, COVER_HEIGHT, IMAGE_HEIGHT} from '../../constants'; import {useSelector} from 'react-redux'; +import {COVER_HEIGHT, IMAGE_WIDTH} from '../../constants'; import {RootState} from '../../store/rootreducer'; import {ScreenType} from '../../types'; @@ -10,7 +10,7 @@ interface CoverProps { screenType: ScreenType; } const Cover: React.FC<CoverProps> = ({userXId, screenType}) => { - const {cover = ''} = userXId + const {cover} = userXId ? useSelector((state: RootState) => state.userX[screenType][userXId]) : useSelector((state: RootState) => state.user); @@ -18,11 +18,8 @@ const Cover: React.FC<CoverProps> = ({userXId, screenType}) => { <View style={[styles.container]}> <Image style={styles.image} - source={ - cover - ? {uri: cover} - : require('../../assets/images/cover-placeholder.png') - } + defaultSource={require('../../assets/images/cover-placeholder.png')} + source={{uri: cover}} /> </View> ); |