From f099df4589515da84a62c16d284bdee058ea5454 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Sat, 20 Feb 2021 11:56:32 -0500 Subject: check if onboarded, added header, loads current sp image --- src/components/profile/ProfileMoreInfoDrawer.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/components') 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 = (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 = (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 = () => { -- cgit v1.2.3-70-g09d2