diff options
author | Ivan Chen <ivan@tagg.id> | 2021-02-20 11:56:32 -0500 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-02-20 11:56:32 -0500 |
commit | f099df4589515da84a62c16d284bdee058ea5454 (patch) | |
tree | 9d073cf8d8075e211aed497ba3b20b315d237bad /src/components | |
parent | bd2df22d84c1c685802356fef52c8f26c44c188d (diff) |
check if onboarded, added header, loads current sp image
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/profile/ProfileMoreInfoDrawer.tsx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/components/profile/ProfileMoreInfoDrawer.tsx b/src/components/profile/ProfileMoreInfoDrawer.tsx index f9cd81a7..90f5da48 100644 --- a/src/components/profile/ProfileMoreInfoDrawer.tsx +++ b/src/components/profile/ProfileMoreInfoDrawer.tsx @@ -1,11 +1,11 @@ import {useNavigation} from '@react-navigation/native'; import React from 'react'; -import {Image, StyleSheet, TouchableOpacity, View} from 'react-native'; +import {Alert, Image, StyleSheet, TouchableOpacity} from 'react-native'; import {useSelector} from 'react-redux'; import MoreIcon from '../../assets/icons/more_horiz-24px.svg'; import PersonOutline from '../../assets/ionicons/person-outline.svg'; -import SuggestedOutline from '../../assets/ionicons/suggested-outline.svg'; import {TAGG_DARK_BLUE, TAGG_LIGHT_BLUE} from '../../constants'; +import {ERROR_ATTEMPT_EDIT_SP} from '../../constants/strings'; import {RootState} from '../../store/rootreducer'; import {SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; import {GenericMoreInfoDrawer} from '../common'; @@ -26,6 +26,9 @@ const ProfileMoreInfoDrawer: React.FC<ProfileMoreInfoDrawerProps> = (props) => { user: {userId, username}, } = useSelector((state: RootState) => state.user); const isOwnProfile = !userXId || userXName === username; + const {suggested_people_linked} = useSelector( + (state: RootState) => state.user.profile, + ); const goToEditProfile = () => { navigation.push('EditProfile', { @@ -36,8 +39,12 @@ const ProfileMoreInfoDrawer: React.FC<ProfileMoreInfoDrawerProps> = (props) => { }; const goToUpdateSPProfile = () => { - navigation.push('UpdateSPPicture'); - setIsOpen(false); + if (suggested_people_linked === 0) { + Alert.alert(ERROR_ATTEMPT_EDIT_SP); + } else { + navigation.push('UpdateSPPicture'); + setIsOpen(false); + } }; const onBlockUnblock = () => { |