diff options
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/suggestedPeopleOnboarding/SuggestedPeopleUploadPictureScreen.tsx | 24 | 
1 files changed, 18 insertions, 6 deletions
| diff --git a/src/screens/suggestedPeopleOnboarding/SuggestedPeopleUploadPictureScreen.tsx b/src/screens/suggestedPeopleOnboarding/SuggestedPeopleUploadPictureScreen.tsx index 92f862c4..37f047d5 100644 --- a/src/screens/suggestedPeopleOnboarding/SuggestedPeopleUploadPictureScreen.tsx +++ b/src/screens/suggestedPeopleOnboarding/SuggestedPeopleUploadPictureScreen.tsx @@ -25,7 +25,7 @@ import {RootState} from '../../store/rootReducer';  import {normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils';  const SuggestedPeopleUploadPictureScreen: React.FC = ({route}) => { -  const {goTo} = route.params; +  const {editing} = route.params;    const [image, setImage] = useState<string | undefined>(undefined);    const [loading, setLoading] = useState(false);    const dispatch = useDispatch(); @@ -42,7 +42,7 @@ const SuggestedPeopleUploadPictureScreen: React.FC = ({route}) => {        }      };      // if we're in edit SP, attempt to load current sp image -    if (goTo === 'Profile') { +    if (editing) {        loadData();      }    }, []); @@ -76,7 +76,7 @@ const SuggestedPeopleUploadPictureScreen: React.FC = ({route}) => {        const success = await sendSuggestedPeoplePhoto(image);        if (success) {          dispatch(uploadedSuggestedPeoplePhoto(image)); -        if (goTo !== 'Profile') { +        if (!editing) {            navigation.push('BadgeSelection');          }        } else { @@ -86,7 +86,7 @@ const SuggestedPeopleUploadPictureScreen: React.FC = ({route}) => {      setLoading(false);      // Navigated back to Profile if user is editing their Suggested People Picture -    if (goTo === 'Profile') { +    if (editing) {        navigation.goBack();        setTimeout(() => {          Alert.alert(SUCCESS_PIC_UPLOAD); @@ -99,9 +99,13 @@ const SuggestedPeopleUploadPictureScreen: React.FC = ({route}) => {        {loading && <TaggLoadingIndicator fullscreen />}        <StatusBar barStyle={'light-content'} />        <SafeAreaView style={styles.container}> -        <Text style={styles.title}>PHOTO</Text> +        <Text style={styles.title}>{editing ? 'Edit Suggested' : 'PHOTO'}</Text>          {image ? ( -          <Text style={styles.body}>Tap again to choose another photo</Text> +          <Text style={styles.body}> +            {editing +              ? 'Tap to upload new photo' +              : 'Tap again to choose another photo'} +          </Text>          ) : (            <Text style={styles.body}>              Upload a photo, this is what other users will see @@ -132,6 +136,14 @@ const SuggestedPeopleUploadPictureScreen: React.FC = ({route}) => {              </ImageBackground>            </TouchableOpacity>          )} +        {editing && ( +          <TouchableOpacity +            onPress={() => { +              navigation.push('BadgeSelection'); +            }}> +            <Text>edit badges ---></Text> +          </TouchableOpacity> +        )}          {image && (            <TaggSquareButton              onPress={uploadImage} | 
