From 080e76350c2570eeb096fad40fe95f1b766b4539 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Mon, 11 Jan 2021 16:11:11 -0500 Subject: created strings.ts and linting --- src/screens/onboarding/CategorySelection.tsx | 5 ++- .../onboarding/InvitationCodeVerification.tsx | 17 +++++--- src/screens/onboarding/Login.tsx | 50 +++++++++++----------- src/screens/onboarding/ProfileOnboarding.tsx | 24 ++++++----- src/screens/onboarding/RegistrationOne.tsx | 10 ++--- src/screens/onboarding/RegistrationThree.tsx | 17 ++++---- src/screens/onboarding/RegistrationTwo.tsx | 6 +-- src/screens/onboarding/Verification.tsx | 10 +++-- src/screens/profile/CaptionScreen.tsx | 21 ++++----- src/screens/profile/EditProfile.tsx | 17 +++++--- 10 files changed, 89 insertions(+), 88 deletions(-) (limited to 'src/screens') diff --git a/src/screens/onboarding/CategorySelection.tsx b/src/screens/onboarding/CategorySelection.tsx index 5589ea9e..a3acbbb7 100644 --- a/src/screens/onboarding/CategorySelection.tsx +++ b/src/screens/onboarding/CategorySelection.tsx @@ -15,11 +15,12 @@ import {useDispatch, useSelector} from 'react-redux'; import PlusIcon from '../../assets/icons/plus_icon-01.svg'; import {Background, MomentCategory} from '../../components'; import {MOMENT_CATEGORIES} from '../../constants'; +import {ERROR_SOMETHING_WENT_WRONG} from '../../constants/strings'; import {OnboardingStackParams} from '../../routes'; import {fcmService, postMomentCategories} from '../../services'; import { - updateMomentCategories, updateIsOnboardedUser, + updateMomentCategories, } from '../../store/actions/'; import {RootState} from '../../store/rootReducer'; import {BackgroundGradientType, CategorySelectionScreenType} from '../../types'; @@ -180,7 +181,7 @@ const CategorySelection: React.FC = ({ } } catch (error) { console.log(error); - Alert.alert('There was a problem'); + Alert.alert(ERROR_SOMETHING_WENT_WRONG); } }; diff --git a/src/screens/onboarding/InvitationCodeVerification.tsx b/src/screens/onboarding/InvitationCodeVerification.tsx index cc7cd678..875523d3 100644 --- a/src/screens/onboarding/InvitationCodeVerification.tsx +++ b/src/screens/onboarding/InvitationCodeVerification.tsx @@ -31,6 +31,12 @@ import { } from 'react-native'; import {BackgroundGradientType} from '../../types'; +import { + ERROR_DOUBLE_CHECK_CONNECTION, + ERROR_INVALID_INVITATION_CODE, + ERROR_INVLAID_CODE, + ERROR_VERIFICATION_FAILED, +} from '../../constants/strings'; type InvitationCodeVerificationScreenNavigationProp = StackNavigationProp< OnboardingStackParams, @@ -66,23 +72,20 @@ const InvitationCodeVerification: React.FC = ({ }, ); - if (verifyInviteCodeResponse.status == 200) { + if (verifyInviteCodeResponse.status === 200) { navigation.navigate('RegistrationOne'); } else { - Alert.alert('Invalid invitation code πŸ€”'); + Alert.alert(ERROR_INVALID_INVITATION_CODE); } } catch (error) { - Alert.alert( - 'Verifiation failed πŸ˜“', - 'Please double-check your network connection and retry.', - ); + Alert.alert(ERROR_VERIFICATION_FAILED, ERROR_DOUBLE_CHECK_CONNECTION); return { name: 'Verification error', description: error, }; } } else { - Alert.alert('The code entered is not valid!'); + Alert.alert(ERROR_INVLAID_CODE); } }; diff --git a/src/screens/onboarding/Login.tsx b/src/screens/onboarding/Login.tsx index d1717fc1..8974e000 100644 --- a/src/screens/onboarding/Login.tsx +++ b/src/screens/onboarding/Login.tsx @@ -1,30 +1,37 @@ -import React, {useEffect, useRef, useState} from 'react'; +import AsyncStorage from '@react-native-community/async-storage'; import {RouteProp} from '@react-navigation/native'; import {StackNavigationProp} from '@react-navigation/stack'; +import React, {useEffect, useRef, useState} from 'react'; import { - View, - Text, Alert, - StatusBar, Image, - TouchableOpacity, - StyleSheet, KeyboardAvoidingView, Platform, + StatusBar, + StyleSheet, + Text, + TouchableOpacity, + View, } from 'react-native'; -import {fcmService} from '../../services'; -import {OnboardingStackParams} from '../../routes/onboarding'; -import {Background, TaggInput, SubmitButton} from '../../components'; +import SplashScreen from 'react-native-splash-screen'; +import {useDispatch} from 'react-redux'; +import {Background, SubmitButton, TaggInput} from '../../components'; import { - usernameRegex, LOGIN_ENDPOINT, TAGG_LIGHT_PURPLE, + usernameRegex, } from '../../constants'; -import AsyncStorage from '@react-native-community/async-storage'; +import { + ERROR_DOUBLE_CHECK_CONNECTION, + ERROR_FAILED_LOGIN_INFO, + ERROR_INVALID_LOGIN, + ERROR_LOGIN_FAILED, + ERROR_SOMETHING_WENT_WRONG_REFRESH, +} from '../../constants/strings'; +import {OnboardingStackParams} from '../../routes/onboarding'; +import {fcmService} from '../../services'; import {BackgroundGradientType, UserType} from '../../types'; -import {useDispatch} from 'react-redux'; import {userLogin} from '../../utils'; -import SplashScreen from 'react-native-splash-screen'; type VerificationScreenRouteProp = RouteProp; type VerificationScreenNavigationProp = StackNavigationProp< @@ -167,28 +174,19 @@ const Login: React.FC = ({navigation}: LoginProps) => { } catch (err) { setUser(NO_USER); console.log(data); - Alert.alert('Auth token storage failed', 'Please login again!'); + Alert.alert(ERROR_INVALID_LOGIN); } } else if (statusCode === 401) { - Alert.alert( - 'Login failed πŸ˜”', - 'Try re-entering your login information.', - ); + Alert.alert(ERROR_FAILED_LOGIN_INFO); } 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); } } else { setForm({...form, attemptedSubmit: false}); setTimeout(() => setForm({...form, attemptedSubmit: true})); } } catch (error) { - Alert.alert( - 'Login failed πŸ˜“', - 'Please double-check your network connection and retry.', - ); + Alert.alert(ERROR_LOGIN_FAILED, ERROR_DOUBLE_CHECK_CONNECTION); return { name: 'Login error', description: error, 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 = ({ 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 = ({ 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, diff --git a/src/screens/onboarding/RegistrationOne.tsx b/src/screens/onboarding/RegistrationOne.tsx index 54c4e210..2a1d884d 100644 --- a/src/screens/onboarding/RegistrationOne.tsx +++ b/src/screens/onboarding/RegistrationOne.tsx @@ -28,6 +28,7 @@ import {SEND_OTP_ENDPOINT} from '../../constants'; import {phoneRegex} from '../../constants'; import {BackgroundGradientType, VerificationScreenType} from '../../types'; +import {ERROR_EMAIL_IN_USE, ERROR_SERVER_DOWN} from '../../constants/strings'; type RegistrationScreenOneRouteProp = RouteProp< OnboardingStackParams, @@ -96,14 +97,9 @@ const RegistrationOne: React.FC = ({navigation}) => { screenType: VerificationScreenType.Phone, }); } else if (otpStatusCode === 409) { - Alert.alert( - 'This phone number is already registered with us, please use another email.', - ); + Alert.alert(ERROR_EMAIL_IN_USE); } else { - Alert.alert( - "Looks like Our phone servers might be down πŸ˜“'", - "Try again in a couple minutes. We're sorry for the inconvenience.", - ); + Alert.alert(ERROR_SERVER_DOWN); } } else { setForm({...form, attemptedSubmit: false}); diff --git a/src/screens/onboarding/RegistrationThree.tsx b/src/screens/onboarding/RegistrationThree.tsx index 52a6de84..03348e6b 100644 --- a/src/screens/onboarding/RegistrationThree.tsx +++ b/src/screens/onboarding/RegistrationThree.tsx @@ -30,6 +30,11 @@ import { import {passwordRegex, usernameRegex, REGISTER_ENDPOINT} from '../../constants'; import AsyncStorage from '@react-native-community/async-storage'; import {BackgroundGradientType} from '../../types'; +import { + ERROR_DOUBLE_CHECK_CONNECTION, + ERROR_REGISTRATION, + ERROR_SOMETHING_WENT_WRONG_REFRESH, +} from '../../constants/strings'; type RegistrationScreenThreeRouteProp = RouteProp< OnboardingStackParams, @@ -189,12 +194,9 @@ const RegistrationThree: React.FC = ({ console.log(err); } } else if (statusCode === 409) { - Alert.alert('Registration failed πŸ˜”', `${data}`); + Alert.alert(ERROR_REGISTRATION(data)); } 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); } } else { Alert.alert( @@ -207,10 +209,7 @@ const RegistrationThree: React.FC = ({ setTimeout(() => setForm({...form, attemptedSubmit: true})); } } catch (error) { - Alert.alert( - 'Registration failed πŸ˜“', - 'Please double-check your network connection and retry.', - ); + Alert.alert(ERROR_REGISTRATION(ERROR_DOUBLE_CHECK_CONNECTION)); return { name: 'Registration error', description: error, diff --git a/src/screens/onboarding/RegistrationTwo.tsx b/src/screens/onboarding/RegistrationTwo.tsx index 2f67d8c8..707e621a 100644 --- a/src/screens/onboarding/RegistrationTwo.tsx +++ b/src/screens/onboarding/RegistrationTwo.tsx @@ -23,6 +23,7 @@ import { import {nameRegex, emailRegex} from '../../constants'; import {BackgroundGradientType} from '../../types'; +import {ERROR_NEXT_PAGE} from '../../constants/strings'; type RegistrationScreenTwoRouteProp = RouteProp< OnboardingStackParams, @@ -143,10 +144,7 @@ const RegistrationTwo: React.FC = ({ setTimeout(() => setForm({...form, attemptedSubmit: true})); } } catch (error) { - Alert.alert( - 'There was a problem while loading the next page πŸ˜“', - "Try again in a couple minutes. We're sorry for the inconvenience.", - ); + Alert.alert(ERROR_NEXT_PAGE); return { name: 'Navigation error', description: error, diff --git a/src/screens/onboarding/Verification.tsx b/src/screens/onboarding/Verification.tsx index c808f30b..0fbe0d91 100644 --- a/src/screens/onboarding/Verification.tsx +++ b/src/screens/onboarding/Verification.tsx @@ -49,6 +49,10 @@ interface VerificationProps { } import {codeRegex} from '../../constants'; +import { + ERROR_INVALID_VERIFICATION_CODE_FORMAT, + ERROR_SOMETHING_WENT_WRONG, +} from '../../constants/strings'; const Verification: React.FC = ({route, navigation}) => { const [value, setValue] = React.useState(''); @@ -93,10 +97,10 @@ const Verification: React.FC = ({route, navigation}) => { } } catch (error) { console.log(error); - Alert.alert('Something went wrong'); + Alert.alert(ERROR_SOMETHING_WENT_WRONG); } } else { - Alert.alert('Please enter a valid 6 digit code'); + Alert.alert(ERROR_INVALID_VERIFICATION_CODE_FORMAT); } }; @@ -115,7 +119,7 @@ const Verification: React.FC = ({route, navigation}) => { } } catch (error) { console.log(error); - Alert.alert('Something went wrong'); + Alert.alert(ERROR_SOMETHING_WENT_WRONG); } }; diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 5537d6bf..bc85d338 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -1,30 +1,27 @@ +import {RouteProp} from '@react-navigation/native'; +import {StackNavigationProp} from '@react-navigation/stack'; import React from 'react'; import { - StyleSheet, - View, Image, - Alert, Keyboard, - TouchableWithoutFeedback, KeyboardAvoidingView, Platform, + StyleSheet, + TouchableWithoutFeedback, + View, } from 'react-native'; import {Button} from 'react-native-elements'; -import {SearchBackground, TaggBigInput} from '../../components'; -import {SCREEN_WIDTH, StatusBarHeight} from '../../utils'; -import AsyncStorage from '@react-native-community/async-storage'; -import {RouteProp} from '@react-navigation/native'; +import {useDispatch, useSelector} from 'react-redux'; import {MainStackParams} from 'src/routes'; -import {StackNavigationProp} from '@react-navigation/stack'; +import {SearchBackground, TaggBigInput} from '../../components'; import {CaptionScreenHeader} from '../../components/'; -import {MOMENTS_ENDPOINT} from '../../constants'; -import {useDispatch, useSelector} from 'react-redux'; +import {postMoment} from '../../services'; import { loadUserMoments, updateProfileCompletionStage, } from '../../store/actions'; import {RootState} from '../../store/rootReducer'; -import {postMoment} from '../../services'; +import {SCREEN_WIDTH, StatusBarHeight} from '../../utils'; /** * Upload Screen to allow users to upload posts to Tagg diff --git a/src/screens/profile/EditProfile.tsx b/src/screens/profile/EditProfile.tsx index a6849c7a..3fea14bf 100644 --- a/src/screens/profile/EditProfile.tsx +++ b/src/screens/profile/EditProfile.tsx @@ -40,6 +40,12 @@ import {RootState} from '../../store/rootReducer'; import {useDispatch, useSelector} from 'react-redux'; import {loadUserData} from '../../store/actions'; import {BackgroundGradientType} from '../../types'; +import { + ERROR_DOUBLE_CHECK_CONNECTION, + ERROR_SOMETHING_WENT_WRONG_REFRESH, + ERROR_UPLOAD_LARGE_PROFILE_PIC, + ERROR_UPLOAD_SMALL_PROFILE_PIC, +} from '../../constants/strings'; type EditProfileNavigationProp = StackNavigationProp< ProfileStackParams, @@ -250,11 +256,11 @@ const EditProfile: React.FC = ({route, navigation}) => { const handleSubmit = useCallback(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.attemptedSubmit) { @@ -355,13 +361,10 @@ const EditProfile: React.FC = ({route, navigation}) => { 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('Please double-check your network connection and retry.'); + Alert.alert(ERROR_DOUBLE_CHECK_CONNECTION); return { name: 'Profile creation error', description: error, -- cgit v1.2.3-70-g09d2 From cc52dabaaf529763e9c1c4683ba94ed55c5671a8 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 15 Jan 2021 14:35:06 -0500 Subject: updated some strings --- src/components/moments/Moment.tsx | 4 +- src/constants/strings.ts | 51 +++++++++++----------- .../onboarding/InvitationCodeVerification.tsx | 4 +- src/screens/onboarding/ProfileOnboarding.tsx | 4 +- src/services/UserProfileService.ts | 4 +- 5 files changed, 34 insertions(+), 33 deletions(-) (limited to 'src/screens') diff --git a/src/components/moments/Moment.tsx b/src/components/moments/Moment.tsx index 56093d65..7905e8a9 100644 --- a/src/components/moments/Moment.tsx +++ b/src/components/moments/Moment.tsx @@ -12,7 +12,7 @@ import PlusIcon from '../../assets/icons/plus_icon-01.svg'; import BigPlusIcon from '../../assets/icons/plus_icon-02.svg'; import UpIcon from '../../assets/icons/up_icon.svg'; import {TAGG_TEXT_LIGHT_BLUE} from '../../constants'; -import {ERROR_UPLOAD_MOMENT} from '../../constants/strings'; +import {ERROR_UPLOAD_MOMENT_SHORT} from '../../constants/strings'; import {SCREEN_WIDTH} from '../../utils'; import MomentTile from './MomentTile'; @@ -69,7 +69,7 @@ const Moment: React.FC = ({ }) .catch((err) => { if (err.code && err.code !== 'E_PICKER_CANCELLED') { - Alert.alert(ERROR_UPLOAD_MOMENT); + Alert.alert(ERROR_UPLOAD_MOMENT_SHORT); } }); }; diff --git a/src/constants/strings.ts b/src/constants/strings.ts index 3b9b6dad..b5344afd 100644 --- a/src/constants/strings.ts +++ b/src/constants/strings.ts @@ -1,46 +1,47 @@ /* eslint-disable */ // Below is the regex to convert this into a csv for the Google Sheet // export const (.*) = .*?(['|"|`])(.*)\2; +// replace with: $1\t$3 export const COMING_SOON_MSG = 'Creating more fun things for you, surprises coming soon πŸ˜‰'; export const ERROR_AUTHENTICATION = 'An error occurred during authentication. Please login again!'; -export const ERROR_CATEGORY_CREATION = 'There was a problem creating categories!'; -export const ERROR_CATEGORY_UPDATE = 'There was a problem updating categories!'; -export const ERROR_DELETE_CATEGORY = 'There was a problem while deleting category!'; -export const ERROR_DELETE_MOMENT = 'We were unable to delete that moment 😭 , please try again later!'; +export const ERROR_CATEGORY_CREATION = 'There was a problem creating your categories. Please refresh and try again.'; +export const ERROR_CATEGORY_UPDATE = 'There was a problem updating your categories. Please refresh and try again'; +export const ERROR_DELETE_CATEGORY = 'There was a problem while deleting category. Please try again'; +export const ERROR_DELETE_MOMENT = 'Unable to delete moment, please try again later!'; export const ERROR_DOUBLE_CHECK_CONNECTION = 'Please double-check your network connection and retry'; -export const ERROR_DUP_OLD_PWD = 'You may not use an already used password'; +export const ERROR_DUP_OLD_PWD = 'You may not use a previously used password'; export const ERROR_EMAIL_IN_USE = 'Email already in use, please try another one'; export const ERROR_FAILED_LOGIN_INFO = 'Login failed, please try re-entering your login information'; export const ERROR_FAILED_TO_COMMENT = 'Unable to post comment, refresh and try again!'; export const ERROR_INVALID_INVITATION_CODE = 'Invitation code invalid, try again or talk to the friend that sent it 😬'; export const ERROR_INVALID_LOGIN = 'Invalid login, Please login again'; -export const ERROR_INVALID_PWD_CODE = 'Looks like you have entered the wrong code'; -export const ERROR_INVALID_VERIFICATION_CODE = 'Invalid verification code, try again. πŸ€” Tap the resend code button to get a new one'; -export const ERROR_INVALID_VERIFICATION_CODE_FORMAT = 'Please enter a valid 6 digit code'; +export const ERROR_INVALID_PWD_CODE = 'Looks like you have entered the wrong code, please try again'; +export const ERROR_INVALID_VERIFICATION_CODE = 'Invalid verification code, try re-entering or tap the resend code button for a new code'; +export const ERROR_INVALID_VERIFICATION_CODE_FORMAT = 'Please enter the 6 digit code sent to your phone'; export const ERROR_INVLAID_CODE = 'The code entered is not valid!'; -export const ERROR_LINK = (str: string) => `Something went wrong, we can\'t link with ${str}, Please refresh and try again`; -export const ERROR_LOGIN = 'There was a problem logging you in, please refresh and try again '; -export const ERROR_LOGIN_FAILED = 'Login failed πŸ˜“'; -export const ERROR_NEXT_PAGE = 'There was a problem while loading the next page πŸ˜“, try again in a couple minutes. Were sorry for the inconvenience.'; -export const ERROR_PROFILE_CREATION = 'Profile creation failed πŸ˜“'; +export const ERROR_LINK = (str: string) => `Unable to link with ${str}, Please check your login and try again`; +export const ERROR_LOGIN = 'There was a problem logging you in, please refresh and try again'; +export const ERROR_LOGIN_FAILED = 'Login failed. Check your username and passoword, and try again'; +export const ERROR_NEXT_PAGE = 'There was a problem while loading the next page πŸ˜“, try again in a couple minutes'; +export const ERROR_PROFILE_CREATION_SHORT = 'Profile creation failed πŸ˜“'; export const ERROR_PWD_ACCOUNT = (str: string) => `Please make sure that the email / username entered is registered with us. You may contact our customer support at ${str}`; export const ERROR_REGISTRATION = (str: string) => `Registration failed πŸ˜”, ${str}`; -export const ERROR_SELECT_CLASS_YEAR = 'Please select Class Year'; +export const ERROR_SELECT_CLASS_YEAR = 'Please select your Class Year'; export const ERROR_SERVER_DOWN = 'mhm, looks like our servers are down, please refresh and try again in a few mins'; -export const ERROR_SOMETHING_WENT_WRONG = "Something went wrong! We don't know what happened... Please give it another try"; +export const ERROR_SOMETHING_WENT_WRONG = "Oh dear, don’t worry someone will be held responsible for this error, In the meantime refresh the app"; export const ERROR_SOMETHING_WENT_WRONG_REFRESH = "Ha, looks like this one's on us, please refresh and try again"; export const ERROR_SOMETHING_WENT_WRONG_RELOAD = "You broke it, Just kidding! we don't know what happened... Please reload the app and try again"; -export const ERROR_UNABLE_TO_FIND_PROFILE = 'We were unable to find this profile πŸ˜”'; -export const ERROR_UNABLE_TO_VIEW_PROFILE = 'You cannot view this profile'; +export const ERROR_UNABLE_TO_FIND_PROFILE = 'We were unable to find this profile. Please check username and try again'; +export const ERROR_UNABLE_TO_VIEW_PROFILE = 'Unable to view this profile'; export const ERROR_UPLOAD = 'An error occurred while uploading. Please try again!'; -export const ERROR_UPLOAD_LARGE_PROFILE_PIC = 'Cant have the first image seen on the profile be blank, please upload a large picture '; -export const ERROR_UPLOAD_MOMENT = 'Unable to upload moment!'; -export const ERROR_UPLOAD_SMALL_PROFILE_PIC = 'Cant have a profile without a pic to represent you, please upload a small profile picture '; -export const ERROR_VERIFICATION_FAILED = 'Verification failed πŸ˜“'; +export const ERROR_UPLOAD_LARGE_PROFILE_PIC = "Can't have the first image seen on the profile be blank, please upload a large picture"; +export const ERROR_UPLOAD_MOMENT = 'Unable to upload moment. Please retry'; +export const ERROR_UPLOAD_SMALL_PROFILE_PIC = "Can't have a profile without a pic to represent you, please upload a small profile picture"; +export const ERROR_VERIFICATION_FAILED_SHORT = 'Verification failed πŸ˜“'; export const MARKED_AS_MSG = (str: string) => `Marked as ${str}`; -export const MOMENT_DELETED_MSG = 'Moment deleted!'; -export const SUCCESS_CATEGORY_DELETE = 'The category was successfully deleted!'; +export const MOMENT_DELETED_MSG = 'Moment deleted....Some moments have to go, to create space for greater ones'; +export const SUCCESS_CATEGORY_DELETE = 'Category successfully deleted, but its memory will live on'; export const SUCCESS_LINK = (str: string) => `Successfully linked ${str} πŸŽ‰`; -export const SUCCESS_PIC_UPLOAD = 'The picture was uploaded successfully!'; -export const SUCCESS_PWD_RESET = 'Your password was reset successfully'; +export const SUCCESS_PIC_UPLOAD = 'Beautiful, the picture was uploaded successfully!'; +export const SUCCESS_PWD_RESET = 'Your password was reset successfully!'; export const SUCCESS_VERIFICATION_CODE_SENT = 'New verification code sent! Check your phone messages for your code'; diff --git a/src/screens/onboarding/InvitationCodeVerification.tsx b/src/screens/onboarding/InvitationCodeVerification.tsx index 875523d3..903a9912 100644 --- a/src/screens/onboarding/InvitationCodeVerification.tsx +++ b/src/screens/onboarding/InvitationCodeVerification.tsx @@ -35,7 +35,7 @@ import { ERROR_DOUBLE_CHECK_CONNECTION, ERROR_INVALID_INVITATION_CODE, ERROR_INVLAID_CODE, - ERROR_VERIFICATION_FAILED, + ERROR_VERIFICATION_FAILED_SHORT, } from '../../constants/strings'; type InvitationCodeVerificationScreenNavigationProp = StackNavigationProp< @@ -78,7 +78,7 @@ const InvitationCodeVerification: React.FC = ({ Alert.alert(ERROR_INVALID_INVITATION_CODE); } } catch (error) { - Alert.alert(ERROR_VERIFICATION_FAILED, ERROR_DOUBLE_CHECK_CONNECTION); + Alert.alert(ERROR_VERIFICATION_FAILED_SHORT, ERROR_DOUBLE_CHECK_CONNECTION); return { name: 'Verification error', description: error, diff --git a/src/screens/onboarding/ProfileOnboarding.tsx b/src/screens/onboarding/ProfileOnboarding.tsx index d0a63a23..127cd9cd 100644 --- a/src/screens/onboarding/ProfileOnboarding.tsx +++ b/src/screens/onboarding/ProfileOnboarding.tsx @@ -34,7 +34,7 @@ import Animated from 'react-native-reanimated'; import {SCREEN_WIDTH} from '../../utils'; import { ERROR_DOUBLE_CHECK_CONNECTION, - ERROR_PROFILE_CREATION, + ERROR_PROFILE_CREATION_SHORT, ERROR_SELECT_CLASS_YEAR, ERROR_SOMETHING_WENT_WRONG_REFRESH, ERROR_UPLOAD_LARGE_PROFILE_PIC, @@ -374,7 +374,7 @@ const ProfileOnboarding: React.FC = ({ Alert.alert(ERROR_SOMETHING_WENT_WRONG_REFRESH); } } catch (error) { - Alert.alert(ERROR_PROFILE_CREATION, ERROR_DOUBLE_CHECK_CONNECTION); + Alert.alert(ERROR_PROFILE_CREATION_SHORT, ERROR_DOUBLE_CHECK_CONNECTION); return { name: 'Profile creation error', description: error, diff --git a/src/services/UserProfileService.ts b/src/services/UserProfileService.ts index 830fbbb9..37d00659 100644 --- a/src/services/UserProfileService.ts +++ b/src/services/UserProfileService.ts @@ -24,7 +24,7 @@ import { ERROR_PWD_ACCOUNT, ERROR_SOMETHING_WENT_WRONG, ERROR_SOMETHING_WENT_WRONG_REFRESH, - ERROR_VERIFICATION_FAILED, + ERROR_VERIFICATION_FAILED_SHORT, SUCCESS_PWD_RESET, SUCCESS_VERIFICATION_CODE_SENT, } from '../constants/strings'; @@ -291,7 +291,7 @@ export const verifyOtp = async (phone: string, otp: string) => { } } } catch (error) { - Alert.alert(ERROR_VERIFICATION_FAILED, ERROR_DOUBLE_CHECK_CONNECTION); + Alert.alert(ERROR_VERIFICATION_FAILED_SHORT, ERROR_DOUBLE_CHECK_CONNECTION); return { name: 'Verification error', description: error, -- cgit v1.2.3-70-g09d2