From 5ff7cab4bd36337b2c86e3d4915a6fc3ceef1ddb Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 20 Apr 2021 17:10:33 -0400 Subject: linted --- src/components/comments/CommentTile.tsx | 6 +++--- src/components/profile/Friends.tsx | 4 +--- src/screens/onboarding/WaitlistSuccessScreen.tsx | 6 +++--- src/screens/profile/CaptionScreen.tsx | 12 +++++++++--- src/screens/profile/FriendsListScreen.tsx | 14 ++++---------- src/store/actions/user.ts | 1 - src/utils/friends.ts | 7 ++++++- 7 files changed, 26 insertions(+), 24 deletions(-) (limited to 'src') 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 = ({ ? `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 = ({ ); }; - const renderRightActions = (progress: Animated.AnimatedInterpolation) => + const renderRightActions = (_: Animated.AnimatedInterpolation) => canDelete ? ( - {renderRightAction('Delete', '#c42634', progress)} + {renderRightAction('Delete', '#c42634')} ) : ( 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; screenType: ScreenType; - userId: string; + userId: string | undefined; } const Friends: React.FC = ({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 = ({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 = ({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 = ({route, navigation}) => { + style={styles.flex}>