aboutsummaryrefslogtreecommitdiff
path: root/src/screens/profile
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/profile
parentd85eaeb878cbbeedda860ee5809b81100c910af2 (diff)
parent30391867438bb28cbcba9fc9ee2ff6d00027fd86 (diff)
Merge branch 'master' into tma538-friend-requests
Diffstat (limited to 'src/screens/profile')
-rw-r--r--src/screens/profile/CaptionScreen.tsx21
-rw-r--r--src/screens/profile/EditProfile.tsx19
-rw-r--r--src/screens/profile/ProfileScreen.tsx4
3 files changed, 22 insertions, 22 deletions
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 d86ae7cb..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<EditProfileProps> = ({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<EditProfileProps> = ({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,
@@ -442,7 +445,7 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => {
valid={form.isValidBio}
attemptedSubmit={form.attemptedSubmit}
invalidWarning={
- 'Bio must be less than 150 characters and must contain valid characters'
+ 'Bio must be less than 150 characters'
}
width={280}
value={form.bio}
diff --git a/src/screens/profile/ProfileScreen.tsx b/src/screens/profile/ProfileScreen.tsx
index 1b9a1049..0ea96cd2 100644
--- a/src/screens/profile/ProfileScreen.tsx
+++ b/src/screens/profile/ProfileScreen.tsx
@@ -3,7 +3,7 @@ import {StatusBar} from 'react-native';
import Animated from 'react-native-reanimated';
import {Content, Cover, TabsGradient} from '../../components';
import {RouteProp, useFocusEffect} from '@react-navigation/native';
-import {ProfileStackParams} from '../../routes/';
+import {MainStackParams} from '../../routes/';
import {resetScreenType} from '../../store/actions';
import {useDispatch, useStore} from 'react-redux';
import {DUMMY_USERID} from '../../store/initialStates';
@@ -13,7 +13,7 @@ import {DUMMY_USERID} from '../../store/initialStates';
* including posts, messaging, and settings
*/
-type ProfileScreenRouteProps = RouteProp<ProfileStackParams, 'Profile'>;
+type ProfileScreenRouteProps = RouteProp<MainStackParams, 'Profile'>;
interface ProfileOnboardingProps {
route: ProfileScreenRouteProps;