From 0bb9f241a4e0ec6b9b22cb9b3b2e5b633b5e43c4 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Tue, 2 Mar 2021 07:45:00 -0800 Subject: Initial --- src/screens/search/DiscoverUsers.tsx | 67 ++++++++++++++++++++++++++++++++++++ src/screens/search/SearchScreen.tsx | 4 +-- src/screens/search/index.ts | 1 + 3 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 src/screens/search/DiscoverUsers.tsx (limited to 'src/screens/search') diff --git a/src/screens/search/DiscoverUsers.tsx b/src/screens/search/DiscoverUsers.tsx new file mode 100644 index 00000000..ac5d8887 --- /dev/null +++ b/src/screens/search/DiscoverUsers.tsx @@ -0,0 +1,67 @@ +import React from 'react'; +import {FlatList, StatusBar, StyleSheet} from 'react-native'; +import {Text} from 'react-native-animatable'; +import {SafeAreaView} from 'react-native-safe-area-context'; +import {HeaderHeight, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; +import {SearchBackground} from '../../components'; +import {RouteProp} from '@react-navigation/native'; +import {MainStackParams} from '../../routes'; +import {StackNavigationProp} from '@react-navigation/stack'; +import {normalize} from '../../utils'; +import {ProfilePreviewType} from 'src/types'; +import ExploreSectionUser from 'src/components/search/ExploreSectionUser'; + +type DiscoverUsersRouteProps = RouteProp; +type DiscoverUsersNavigationProps = StackNavigationProp< + MainStackParams, + 'DiscoverUsers' +>; + +interface DiscoverUsersProps { + route: DiscoverUsersRouteProps; +} + +const DiscoverUsers: React.FC = ({route}) => { + const {searchCategory} = route.params; + // Make a function call to server to return users list in this search category + const users: ProfilePreviewType[] = []; + return ( + + + + {searchCategory} + } + renderItem={({item: user}: {item: ProfilePreviewType}) => ( + + )} + /> + + + ); +}; + +const styles = StyleSheet.create({ + header: {width: SCREEN_WIDTH, backgroundColor: 'lightgreen'}, + headerText: { + color: '#fff', + fontWeight: '600', + fontSize: normalize(18), + lineHeight: normalize(35), + }, + scrollView: { + width: SCREEN_WIDTH * 0.9, + height: SCREEN_HEIGHT * 0.8, + alignItems: 'center', + marginHorizontal: '5%', + paddingBottom: '10%', + }, + scrollViewContainer: {marginTop: HeaderHeight}, + user: { + marginHorizontal: 5, + }, +}); + +export default DiscoverUsers; diff --git a/src/screens/search/SearchScreen.tsx b/src/screens/search/SearchScreen.tsx index e4ac4c9e..5c59bc0e 100644 --- a/src/screens/search/SearchScreen.tsx +++ b/src/screens/search/SearchScreen.tsx @@ -14,7 +14,7 @@ import Animated, {Easing, timing} from 'react-native-reanimated'; import {SafeAreaView} from 'react-native-safe-area-context'; import {useDispatch, useSelector} from 'react-redux'; import { - Explore, + SearchCategories, RecentSearches, SearchBar, SearchResultList, @@ -173,7 +173,7 @@ const SearchScreen: React.FC = () => { Try searching for people, groups, or clubs - + {results === undefined && recents.length !== 0 ? (