diff options
author | Leon Jiang <35908040+leonyjiang@users.noreply.github.com> | 2020-07-20 16:27:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-20 19:27:45 -0400 |
commit | e87d4f2b10cff8cf5f31784cfddb22727a94f373 (patch) | |
tree | dd454883f3f4054e895c7ce80f2845d68ba31364 /src/screens/onboarding/Verification.tsx | |
parent | c38291fb50e30af0739f17de42f3b8bb51cca73e (diff) |
[TMA-134] Profile Picture Upload (#22)
* Fix styling, remove unnecessary state
* Change large profile to square crop, restyle
* Disable gestures on Verification and Profile screens
* Forward username and ID to Profile screen
* Add API request upon submit & filler components
* Restore gestures to Verification and Profile
* Rewrite network failure error message
* Update profile request form keys
Diffstat (limited to 'src/screens/onboarding/Verification.tsx')
-rw-r--r-- | src/screens/onboarding/Verification.tsx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/screens/onboarding/Verification.tsx b/src/screens/onboarding/Verification.tsx index 77a43a6d..baa5c6b3 100644 --- a/src/screens/onboarding/Verification.tsx +++ b/src/screens/onboarding/Verification.tsx @@ -42,9 +42,7 @@ const Verification: React.FC<VerificationProps> = ({route, navigation}) => { value, setValue, }); - const registrationVals = route.params; - const username: string = registrationVals!.username; - const email: string = registrationVals!.email; + const {username, email, userId} = route.params; /** * Sends the verify_otp request upon tapping the Verify button. @@ -61,7 +59,10 @@ const Verification: React.FC<VerificationProps> = ({route, navigation}) => { }); let statusCode = verifyOtpResponse.status; if (statusCode === 200) { - navigation.navigate('Profile'); + navigation.navigate('Profile', { + userId: userId, + username: username, + }); } else { Alert.alert( 'Invalid verification code 🤔', @@ -69,7 +70,14 @@ const Verification: React.FC<VerificationProps> = ({route, navigation}) => { ); } } catch (error) { - console.log(error); + Alert.alert( + 'Verifiation failed 😓', + 'Please double-check your network connection and retry.', + ); + return { + name: 'Verification error', + description: error, + }; } }; |