diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/comments/CommentTile.tsx | 6 | ||||
-rw-r--r-- | src/components/profile/Friends.tsx | 4 | ||||
-rw-r--r-- | src/screens/onboarding/WaitlistSuccessScreen.tsx | 6 | ||||
-rw-r--r-- | src/screens/profile/CaptionScreen.tsx | 12 | ||||
-rw-r--r-- | src/screens/profile/FriendsListScreen.tsx | 14 | ||||
-rw-r--r-- | src/store/actions/user.ts | 1 | ||||
-rw-r--r-- | src/utils/friends.ts | 7 |
7 files changed, 26 insertions, 24 deletions
diff --git a/src/components/comments/CommentTile.tsx b/src/components/comments/CommentTile.tsx index be113523..34eef418 100644 --- a/src/components/comments/CommentTile.tsx +++ b/src/components/comments/CommentTile.tsx @@ -108,7 +108,7 @@ const CommentTile: React.FC<CommentTileProps> = ({ ? `Replies (${comment_object.replies_count})` : 'Replies'; - const renderRightAction = (text: string, color: string, progress) => { + const renderRightAction = (text: string, color: string) => { const pressHandler = async () => { swipeRef.current?.close(); const success = await deleteComment(comment_object.comment_id, isThread); @@ -130,10 +130,10 @@ const CommentTile: React.FC<CommentTileProps> = ({ ); }; - const renderRightActions = (progress: Animated.AnimatedInterpolation) => + const renderRightActions = (_: Animated.AnimatedInterpolation) => canDelete ? ( <View style={styles.swipeActions}> - {renderRightAction('Delete', '#c42634', progress)} + {renderRightAction('Delete', '#c42634')} </View> ) : ( <Fragment /> diff --git a/src/components/profile/Friends.tsx b/src/components/profile/Friends.tsx index b754b71a..a7a06567 100644 --- a/src/components/profile/Friends.tsx +++ b/src/components/profile/Friends.tsx @@ -1,4 +1,3 @@ -import {useNavigation} from '@react-navigation/native'; import React, {useEffect, useState} from 'react'; import {ScrollView, StyleSheet, Text, View} from 'react-native'; import {checkPermission} from 'react-native-contacts'; @@ -21,14 +20,13 @@ import {ProfilePreview} from '../profile'; interface FriendsProps { result: Array<ProfilePreviewType>; screenType: ScreenType; - userId: string; + userId: string | undefined; } const Friends: React.FC<FriendsProps> = ({result, screenType, userId}) => { const state: RootState = useStore().getState(); const dispatch = useDispatch(); const {user: loggedInUser = NO_USER} = state.user; - const navigation = useNavigation(); const [usersFromContacts, setUsersFromContacts] = useState< ProfilePreviewType[] >([]); diff --git a/src/screens/onboarding/WaitlistSuccessScreen.tsx b/src/screens/onboarding/WaitlistSuccessScreen.tsx index 1f603e3a..f21672f1 100644 --- a/src/screens/onboarding/WaitlistSuccessScreen.tsx +++ b/src/screens/onboarding/WaitlistSuccessScreen.tsx @@ -10,12 +10,12 @@ import { TouchableOpacity, View, } from 'react-native'; -import {ArrowButton, Background, SubmitButton} from '../../components'; +import CelebrationLogo from '../../assets/icons/celebration-logo.svg'; +import {ArrowButton, Background} from '../../components'; +import {TAGG_WEBSITE} from '../../constants'; import {OnboardingStackParams} from '../../routes'; import {BackgroundGradientType} from '../../types'; -import CelebrationLogo from '../../assets/icons/celebration-logo.svg'; import {SCREEN_HEIGHT} from '../../utils'; -import {TAGG_WEBSITE} from '../../constants'; type WaitlistSuccessScreenProp = StackNavigationProp< OnboardingStackParams, diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 998897e2..c039b8cb 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -48,8 +48,8 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { const [caption, setCaption] = useState(''); const [loading, setLoading] = useState(false); - const handleCaptionUpdate = (caption: string) => { - setCaption(caption); + const handleCaptionUpdate = (newCaption: string) => { + setCaption(newCaption); }; const navigateToProfile = () => { @@ -62,6 +62,9 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { const handleShare = async () => { setLoading(true); + if (!image.filename) { + return; + } postMoment(image.filename, image.path, caption, title, userId).then( (data) => { setLoading(false); @@ -87,7 +90,7 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => { <TouchableWithoutFeedback onPress={Keyboard.dismiss}> <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'} - style={{flex: 1}}> + style={styles.flex}> <View style={styles.contentContainer}> <View style={styles.buttonsContainer}> <Button @@ -156,6 +159,9 @@ const styles = StyleSheet.create({ paddingVertical: '1%', height: 60, }, + flex: { + flex: 1, + }, }); export default CaptionScreen; diff --git a/src/screens/profile/FriendsListScreen.tsx b/src/screens/profile/FriendsListScreen.tsx index 886ab9c4..1d10bc86 100644 --- a/src/screens/profile/FriendsListScreen.tsx +++ b/src/screens/profile/FriendsListScreen.tsx @@ -1,12 +1,6 @@ import {RouteProp} from '@react-navigation/native'; import React from 'react'; -import { - SafeAreaView, - ScrollView, - StatusBar, - StyleSheet, - View, -} from 'react-native'; +import {SafeAreaView, ScrollView, StatusBar, StyleSheet} from 'react-native'; import {useSelector} from 'react-redux'; import {Friends, TabsGradient} from '../../components'; import {MainStackParams} from '../../routes'; @@ -24,9 +18,9 @@ interface FriendsListScreenProps { const FriendsListScreen: React.FC<FriendsListScreenProps> = ({route}) => { const {userXId, screenType} = route.params; - const {friends} = userXId - ? useSelector((state: RootState) => state.userX[screenType][userXId]) - : useSelector((state: RootState) => state.friends); + const {friends} = useSelector((state: RootState) => + userXId ? state.userX[screenType][userXId] : state.friends, + ); return ( <> diff --git a/src/store/actions/user.ts b/src/store/actions/user.ts index c7d0d5a7..3ebd4190 100644 --- a/src/store/actions/user.ts +++ b/src/store/actions/user.ts @@ -233,4 +233,3 @@ export const suggestedPeopleAnimatedTutorialFinished = ( console.log('Error while updating suggested people linked state: ', error); } }; - diff --git a/src/utils/friends.ts b/src/utils/friends.ts index 5b0ded8f..93d9e054 100644 --- a/src/utils/friends.ts +++ b/src/utils/friends.ts @@ -1,7 +1,12 @@ // Handles click on friend/requested/unfriend button import {RootState} from '../store/rootReducer'; -import {ProfilePreviewType, ProfileInfoType, ScreenType, UserType} from '../types'; +import { + ProfilePreviewType, + ProfileInfoType, + ScreenType, + UserType, +} from '../types'; import {AppDispatch} from '../store/configureStore'; import { addFriend, |