diff options
Diffstat (limited to 'src/screens/onboarding/ProfileOnboarding.tsx')
-rw-r--r-- | src/screens/onboarding/ProfileOnboarding.tsx | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/screens/onboarding/ProfileOnboarding.tsx b/src/screens/onboarding/ProfileOnboarding.tsx index e13ccc5a..7e489d6d 100644 --- a/src/screens/onboarding/ProfileOnboarding.tsx +++ b/src/screens/onboarding/ProfileOnboarding.tsx @@ -47,7 +47,10 @@ interface ProfileOnboardingProps { * @param navigation react-navigation navigation object */ -const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({route}) => { +const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({ + route, + navigation, +}) => { const {userId, username} = route.params; const [form, setForm] = React.useState({ largePic: '', @@ -97,12 +100,6 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({route}) => { }; /** - * login: determines if user successully created an account to - * navigate to home and display main tab navigation bar - */ - const {login} = React.useContext(AuthContext); - - /** * Profile screen "Add Large Profile Pic Here" button */ const LargeProfilePic = () => ( @@ -112,10 +109,7 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({route}) => { onPress={goToGalleryLargePic} style={styles.largeProfileUploader}> {form.largePic ? ( - <Image - source={{uri: form.largePic}} - style={styles.largeProfilePic} - /> + <Image source={{uri: form.largePic}} style={styles.largeProfilePic} /> ) : ( <Text style={styles.largeProfileText}>ADD LARGE PROFILE PIC HERE</Text> )} @@ -132,10 +126,7 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({route}) => { onPress={goToGallerySmallPic} style={styles.smallProfileUploader}> {form.smallPic ? ( - <Image - source={{uri: form.smallPic}} - style={styles.smallProfilePic} - /> + <Image source={{uri: form.smallPic}} style={styles.smallProfilePic} /> ) : ( <Text style={styles.smallProfileText}>ADD SMALLER PIC</Text> )} @@ -328,7 +319,10 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({route}) => { let statusCode = response.status; let data = await response.json(); if (statusCode === 200) { - login(userId, username); + navigation.navigate('SocialMedia', { + userId: userId, + username: username, + }); } else if (statusCode === 400) { Alert.alert( 'Profile update failed. 😔', |