aboutsummaryrefslogtreecommitdiff
path: root/src/screens/onboarding/ProfileOnboarding.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2021-01-16 09:51:36 -0800
committerGitHub <noreply@github.com>2021-01-16 09:51:36 -0800
commit9711093bfa5810868e3cd17008bb7b3ddc7b9034 (patch)
tree6a8bb4341b1623cfc2da86af4b3b28c1fd3f8a44 /src/screens/onboarding/ProfileOnboarding.tsx
parentd85eaeb878cbbeedda860ee5809b81100c910af2 (diff)
parent30391867438bb28cbcba9fc9ee2ff6d00027fd86 (diff)
Merge branch 'master' into tma538-friend-requests
Diffstat (limited to 'src/screens/onboarding/ProfileOnboarding.tsx')
-rw-r--r--src/screens/onboarding/ProfileOnboarding.tsx24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/screens/onboarding/ProfileOnboarding.tsx b/src/screens/onboarding/ProfileOnboarding.tsx
index 1f8e58da..127cd9cd 100644
--- a/src/screens/onboarding/ProfileOnboarding.tsx
+++ b/src/screens/onboarding/ProfileOnboarding.tsx
@@ -32,6 +32,14 @@ import {BackgroundGradientType} from '../../types';
import {PickerSelectProps} from 'react-native-picker-select';
import Animated from 'react-native-reanimated';
import {SCREEN_WIDTH} from '../../utils';
+import {
+ ERROR_DOUBLE_CHECK_CONNECTION,
+ ERROR_PROFILE_CREATION_SHORT,
+ ERROR_SELECT_CLASS_YEAR,
+ ERROR_SOMETHING_WENT_WRONG_REFRESH,
+ ERROR_UPLOAD_LARGE_PROFILE_PIC,
+ ERROR_UPLOAD_SMALL_PROFILE_PIC,
+} from '../../constants/strings';
type ProfileOnboardingScreenRouteProp = RouteProp<
OnboardingStackParams,
@@ -260,15 +268,15 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({
const handleSubmit = async () => {
if (!form.largePic) {
- Alert.alert('Please select a Header image!');
+ Alert.alert(ERROR_UPLOAD_LARGE_PROFILE_PIC);
return;
}
if (!form.smallPic) {
- Alert.alert('Please select a Profile Picture!');
+ Alert.alert(ERROR_UPLOAD_SMALL_PROFILE_PIC);
return;
}
if (form.classYear === -1) {
- Alert.alert('Please select Class Year');
+ Alert.alert(ERROR_SELECT_CLASS_YEAR);
return;
}
if (!form.attemptedSubmit) {
@@ -363,16 +371,10 @@ const ProfileOnboarding: React.FC<ProfileOnboardingProps> = ({
data.error || 'Something went wrong! 😭',
);
} else {
- Alert.alert(
- 'Something went wrong! 😭',
- "Would you believe me if I told you that I don't know what happened?",
- );
+ Alert.alert(ERROR_SOMETHING_WENT_WRONG_REFRESH);
}
} catch (error) {
- Alert.alert(
- 'Profile creation failed 😓',
- 'Please double-check your network connection and retry.',
- );
+ Alert.alert(ERROR_PROFILE_CREATION_SHORT, ERROR_DOUBLE_CHECK_CONNECTION);
return {
name: 'Profile creation error',
description: error,