diff options
Diffstat (limited to 'src/components/search')
| -rw-r--r-- | src/components/search/DiscoverUsers.tsx | 19 | ||||
| -rw-r--r-- | src/components/search/RecentSearches.tsx | 13 | ||||
| -rw-r--r-- | src/components/search/SearchResults.tsx | 14 |
3 files changed, 33 insertions, 13 deletions
diff --git a/src/components/search/DiscoverUsers.tsx b/src/components/search/DiscoverUsers.tsx index 885c712b..ec0a8daa 100644 --- a/src/components/search/DiscoverUsers.tsx +++ b/src/components/search/DiscoverUsers.tsx @@ -6,23 +6,32 @@ import { StyleSheet, TouchableOpacityProps, } from 'react-native'; -import {ProfilePreviewType} from '../../types'; +import {PreviewType, ProfilePreviewType, ScreenType} from '../../types'; import SearchResults from './SearchResults'; interface DiscoverUsersProps extends TouchableOpacityProps { - sectionTitle: string; + sectionTitle: PreviewType; users: Array<ProfilePreviewType>; + screenType: ScreenType; } /** * An image component that returns the <Image> of the icon for a specific social media platform. */ -const DiscoverUsers: React.FC<DiscoverUsersProps> = (props) => { +const DiscoverUsers: React.FC<DiscoverUsersProps> = ({ + sectionTitle, + screenType, + users, +}) => { return ( <View style={styles.container}> <View style={styles.headerContainer}> - <Text style={styles.title}>{props.sectionTitle}</Text> + <Text style={styles.title}>{sectionTitle}</Text> </View> - <SearchResults results={props.users} previewType={props.sectionTitle} /> + <SearchResults + results={users} + previewType={sectionTitle} + screenType={screenType} + /> </View> ); }; diff --git a/src/components/search/RecentSearches.tsx b/src/components/search/RecentSearches.tsx index 6a98e49a..22a36a6b 100644 --- a/src/components/search/RecentSearches.tsx +++ b/src/components/search/RecentSearches.tsx @@ -6,14 +6,15 @@ import { StyleSheet, TouchableOpacityProps, } from 'react-native'; -import {ProfilePreviewType} from 'src/types'; -import { TAGG_TEXT_LIGHT_BLUE } from '../../constants'; +import {PreviewType, ProfilePreviewType, ScreenType} from 'src/types'; +import {TAGG_TEXT_LIGHT_BLUE} from '../../constants'; import SearchResults from './SearchResults'; interface RecentSearchesProps extends TouchableOpacityProps { - sectionTitle: string; + sectionTitle: PreviewType; sectionButtonTitle: string; recents: Array<ProfilePreviewType>; + screenType: ScreenType; } /** * An image component that returns the <Image> of the icon for a specific social media platform. @@ -29,7 +30,11 @@ const RecentSearches: React.FC<RecentSearchesProps> = (props) => { </TouchableOpacity> )} </View> - <SearchResults results={props.recents} previewType={props.sectionTitle} /> + <SearchResults + results={props.recents} + previewType={props.sectionTitle} + screenType={props.screenType} + /> </> ); }; diff --git a/src/components/search/SearchResults.tsx b/src/components/search/SearchResults.tsx index 2d5c9db8..001c7968 100644 --- a/src/components/search/SearchResults.tsx +++ b/src/components/search/SearchResults.tsx @@ -1,20 +1,26 @@ import React from 'react'; -import {ProfilePreviewType, PreviewType} from '../../types'; +import {ProfilePreviewType, PreviewType, ScreenType} from '../../types'; import ProfilePreview from '../profile/ProfilePreview'; import {StyleSheet, View} from 'react-native'; interface SearchResultsProps { results: Array<ProfilePreviewType>; previewType: PreviewType; + screenType: ScreenType; } -const SearchResults: React.FC<SearchResultsProps> = (props) => { +const SearchResults: React.FC<SearchResultsProps> = ({ + results, + previewType, + screenType, +}) => { return ( <View style={styles.container}> - {props.results.map((profilePreview) => ( + {results.map((profilePreview) => ( <ProfilePreview style={styles.result} key={profilePreview.id} {...{profilePreview}} - previewType={props.previewType} + previewType={previewType} + screenType={screenType} /> ))} </View> |
