From 2fd91821fccdf647193f5be1af87c6ef903096a1 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Fri, 5 Mar 2021 16:13:23 -0800 Subject: lint --- src/components/profile/Content.tsx | 7 ++-- .../SuggestedPeopleOnboardingStackNavigator.tsx | 4 ++- src/screens/search/SearchScreen.tsx | 37 ++++------------------ 3 files changed, 13 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx index ae9f9564..d4c50d5c 100644 --- a/src/components/profile/Content.tsx +++ b/src/components/profile/Content.tsx @@ -109,10 +109,9 @@ const Content: React.FC = ({y, userXId, screenType}) => { const [isStageOnePromptClosed, setIsStageOnePromptClosed] = useState( false, ); - const [ - isStageThreePromptClosed, - setIsStageThreePromptClosed, - ] = useState(false); + const [isStageThreePromptClosed, setIsStageThreePromptClosed] = useState< + boolean + >(false); const onRefresh = useCallback(() => { const refrestState = async () => { diff --git a/src/routes/suggestedPeopleOnboarding/SuggestedPeopleOnboardingStackNavigator.tsx b/src/routes/suggestedPeopleOnboarding/SuggestedPeopleOnboardingStackNavigator.tsx index 737c503c..63547acb 100644 --- a/src/routes/suggestedPeopleOnboarding/SuggestedPeopleOnboardingStackNavigator.tsx +++ b/src/routes/suggestedPeopleOnboarding/SuggestedPeopleOnboardingStackNavigator.tsx @@ -8,4 +8,6 @@ export type SuggestedPeopleOnboardingStackParams = { BadgeSelection: undefined; }; -export const SuggestedPeopleOnboardingStack = createStackNavigator(); +export const SuggestedPeopleOnboardingStack = createStackNavigator< + SuggestedPeopleOnboardingStackParams +>(); diff --git a/src/screens/search/SearchScreen.tsx b/src/screens/search/SearchScreen.tsx index 87efc3fd..1f8f88f0 100644 --- a/src/screens/search/SearchScreen.tsx +++ b/src/screens/search/SearchScreen.tsx @@ -1,20 +1,11 @@ import AsyncStorage from '@react-native-community/async-storage'; import {useFocusEffect} from '@react-navigation/native'; -import React, {useCallback, useEffect, useState} from 'react'; -import { - Keyboard, - RefreshControl, - ScrollView, - StatusBar, - StyleSheet, - Text, - View, -} from 'react-native'; +import React, {useEffect, useState} from 'react'; +import {Keyboard, ScrollView, StatusBar, StyleSheet, View} from 'react-native'; import Animated, {Easing, timing} from 'react-native-reanimated'; import {SafeAreaView} from 'react-native-safe-area-context'; import {useDispatch, useSelector} from 'react-redux'; import { - SearchCategories, RecentSearches, SearchBar, SearchResultList, @@ -23,7 +14,7 @@ import { } from '../../components'; import {SEARCH_ENDPOINT, TAGG_LIGHT_BLUE} from '../../constants'; import {loadSearchResults} from '../../services'; -import {loadRecentlySearched, resetScreenType} from '../../store/actions'; +import {resetScreenType} from '../../store/actions'; import {RootState} from '../../store/rootReducer'; import {ProfilePreviewType, ScreenType} from '../../types'; import {normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; @@ -42,7 +33,6 @@ const SearchScreen: React.FC = () => { ); const [searching, setSearching] = useState(false); const top = Animated.useValue(-SCREEN_HEIGHT); - const [refreshing, setRefreshing] = useState(false); const [keyboardVisible, setKeyboardVisible] = React.useState( 'keyboardVisible', ); @@ -59,16 +49,6 @@ const SearchScreen: React.FC = () => { }, []); const dispatch = useDispatch(); - const onRefresh = useCallback(() => { - const refrestState = async () => { - dispatch(loadRecentlySearched()); - }; - setRefreshing(true); - refrestState().then(() => { - setRefreshing(false); - }); - }, []); - useEffect(() => { if (query.length < 3) { setResults(undefined); @@ -157,10 +137,7 @@ const SearchScreen: React.FC = () => { keyboardShouldPersistTaps={'always'} stickyHeaderIndices={[4]} contentContainerStyle={styles.contentContainer} - showsVerticalScrollIndicator={false} - refreshControl={ - - }> + showsVerticalScrollIndicator={false}>