diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 2 | ||||
-rw-r--r-- | src/screens/profile/EditProfile.tsx | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 3d422e8a..91aaa617 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -83,12 +83,12 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { return ( <SearchBackground> + {loading ? <TaggLoadingIndicator fullscreen /> : <Fragment />} <TouchableWithoutFeedback onPress={Keyboard.dismiss}> <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'} style={{flex: 1}}> <View style={styles.contentContainer}> - {loading ? <TaggLoadingIndicator fullscreen /> : <Fragment />} <View style={styles.buttonsContainer}> <Button title="Cancel" diff --git a/src/screens/profile/EditProfile.tsx b/src/screens/profile/EditProfile.tsx index 3fea14bf..3b3fa36e 100644 --- a/src/screens/profile/EditProfile.tsx +++ b/src/screens/profile/EditProfile.tsx @@ -1,6 +1,5 @@ -import React, {useCallback, useEffect, useState} from 'react'; +import React, {Fragment, useCallback, useEffect, useState} from 'react'; import {RouteProp} from '@react-navigation/native'; -import moment from 'moment'; import {StackNavigationProp} from '@react-navigation/stack'; import { Text, @@ -21,7 +20,6 @@ import { TaggBigInput, TaggInput, TaggDropDown, - BirthDatePicker, TabsGradient, SocialIcon, } from '../../components'; @@ -46,6 +44,7 @@ import { ERROR_UPLOAD_LARGE_PROFILE_PIC, ERROR_UPLOAD_SMALL_PROFILE_PIC, } from '../../constants/strings'; +import TaggLoadingIndicator from '../../components/common/TaggLoadingIndicator'; type EditProfileNavigationProp = StackNavigationProp< ProfileStackParams, @@ -72,6 +71,7 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { } = useSelector((state: RootState) => state.user); const [needsUpdate, setNeedsUpdate] = useState(false); + const [loading, setLoading] = useState(false); const dispatch = useDispatch(); useEffect(() => { @@ -379,7 +379,10 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { title={'Save'} buttonStyle={{backgroundColor: 'transparent'}} titleStyle={{fontWeight: 'bold'}} - onPress={handleSubmit} + onPress={() => { + setLoading(true); + handleSubmit().then(() => setLoading(false)); + }} /> ), }); @@ -387,6 +390,7 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { return ( <Background centered gradientType={BackgroundGradientType.Light}> + {loading ? <TaggLoadingIndicator fullscreen /> : <Fragment />} <SafeAreaView> <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'}> @@ -444,9 +448,7 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { blurOnSubmit={false} valid={form.isValidBio} attemptedSubmit={form.attemptedSubmit} - invalidWarning={ - 'Bio must be less than 150 characters' - } + invalidWarning={'Bio must be less than 150 characters'} width={280} value={form.bio} /> @@ -477,7 +479,6 @@ const EditProfile: React.FC<EditProfileProps> = ({route, navigation}) => { 'Custom field can only contain letters and hyphens' } onChangeText={handleCustomGenderUpdate} - onSubmitEditing={() => handleSubmit()} placeholder="Enter your gender" returnKeyType="done" style={styles.customGenderInput} |