aboutsummaryrefslogtreecommitdiff
path: root/src/screens/onboarding/ProfileOnboarding.tsx
diff options
context:
space:
mode:
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..d0a63a23 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,
+ 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, ERROR_DOUBLE_CHECK_CONNECTION);
return {
name: 'Profile creation error',
description: error,