aboutsummaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-05 16:14:15 -0500
committerIvan Chen <ivan@tagg.id>2021-03-05 16:14:15 -0500
commit7cc6df961f99d5828f6cbe39c7509e17bae7d93c (patch)
tree50c5b55c5acbe784f5f54e9861f71652ff709804 /src/screens
parent79396f899fe25f611d790d918e8ae4275a61e43c (diff)
fixed padding issue
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/search/SearchScreen.tsx45
1 files changed, 18 insertions, 27 deletions
diff --git a/src/screens/search/SearchScreen.tsx b/src/screens/search/SearchScreen.tsx
index b6841480..70733d7e 100644
--- a/src/screens/search/SearchScreen.tsx
+++ b/src/screens/search/SearchScreen.tsx
@@ -3,12 +3,10 @@ import {useFocusEffect} from '@react-navigation/native';
import React, {useCallback, useEffect, useState} from 'react';
import {
Keyboard,
- KeyboardAvoidingView,
RefreshControl,
ScrollView,
StatusBar,
StyleSheet,
- SafeAreaView,
} from 'react-native';
import Animated, {Easing, timing} from 'react-native-reanimated';
import {useDispatch, useSelector} from 'react-redux';
@@ -23,15 +21,11 @@ import {
TabsGradient,
} from '../../components';
import {SEARCH_ENDPOINT, TAGG_LIGHT_BLUE} from '../../constants';
+import {loadSearchResults} from '../../services';
import {loadRecentlySearched, resetScreenType} from '../../store/actions';
import {RootState} from '../../store/rootReducer';
-import {ProfilePreviewType, ScreenType, UserType} from '../../types';
+import {ProfilePreviewType, ScreenType} from '../../types';
import {SCREEN_HEIGHT, SCREEN_WIDTH, StatusBarHeight} from '../../utils';
-import {loadSearchResults} from '../../services';
-const NO_USER: UserType = {
- userId: '',
- username: '',
-};
/**
* Search Screen for user recommendations and a search
@@ -178,25 +172,22 @@ const SearchScreen: React.FC = () => {
<Explore />
<SearchResultsBackground {...{top}}>
- <KeyboardAvoidingView
- behavior={'padding'}
- keyboardVerticalOffset={SCREEN_HEIGHT * 0.1}>
- {results === undefined && recents.length !== 0 ? (
- <RecentSearches
- sectionTitle="Recent"
- sectionButtonTitle="Clear all"
- onPress={clearRecentlySearched}
- recents={recents}
- screenType={ScreenType.Search}
- />
- ) : (
- <SearchResultList
- {...{results}}
- previewType={'Search'}
- screenType={ScreenType.Search}
- />
- )}
- </KeyboardAvoidingView>
+ {results === undefined && recents.length !== 0 ? (
+ <RecentSearches
+ sectionTitle="Recent"
+ sectionButtonTitle="Clear all"
+ onPress={clearRecentlySearched}
+ recents={recents}
+ screenType={ScreenType.Search}
+ />
+ ) : (
+ <SearchResultList
+ {...{results}}
+ keyboardVisible={keyboardVisible === 'keyboardVisibleTrue'}
+ previewType={'Search'}
+ screenType={ScreenType.Search}
+ />
+ )}
</SearchResultsBackground>
</ScrollView>
<TabsGradient />