aboutsummaryrefslogtreecommitdiff
path: root/src/components/search/DiscoverUsers.tsx
diff options
context:
space:
mode:
authorShravya Ramesh <37447613+shravyaramesh@users.noreply.github.com>2020-11-20 13:20:49 -0800
committerGitHub <noreply@github.com>2020-11-20 16:20:49 -0500
commit3214fc765cbce3c6f9092546424249d08622afb1 (patch)
tree862aa8872d670195f2a33264f672782ea1077c9c /src/components/search/DiscoverUsers.tsx
parent713d169915a82edfcfe4b44622e3dce8c6adaf0c (diff)
[TMA-375] Added discover users to explore (#119)
* Added discover users to explore * Filtered following users out * Removed reload button and filtering following users from discover page * Wrapped contents * Preview type in types.ts
Diffstat (limited to 'src/components/search/DiscoverUsers.tsx')
-rw-r--r--src/components/search/DiscoverUsers.tsx46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/components/search/DiscoverUsers.tsx b/src/components/search/DiscoverUsers.tsx
new file mode 100644
index 00000000..885c712b
--- /dev/null
+++ b/src/components/search/DiscoverUsers.tsx
@@ -0,0 +1,46 @@
+import React from 'react';
+import {
+ View,
+ Text,
+ TouchableOpacity,
+ StyleSheet,
+ TouchableOpacityProps,
+} from 'react-native';
+import {ProfilePreviewType} from '../../types';
+import SearchResults from './SearchResults';
+
+interface DiscoverUsersProps extends TouchableOpacityProps {
+ sectionTitle: string;
+ users: Array<ProfilePreviewType>;
+}
+/**
+ * An image component that returns the <Image> of the icon for a specific social media platform.
+ */
+const DiscoverUsers: React.FC<DiscoverUsersProps> = (props) => {
+ return (
+ <View style={styles.container}>
+ <View style={styles.headerContainer}>
+ <Text style={styles.title}>{props.sectionTitle}</Text>
+ </View>
+ <SearchResults results={props.users} previewType={props.sectionTitle} />
+ </View>
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ margin: '5%',
+ },
+ headerContainer: {
+ flexDirection: 'row',
+ marginBottom: '1%',
+ },
+ title: {
+ fontSize: 19,
+ fontWeight: 'bold',
+ flexGrow: 1,
+ color: 'white',
+ },
+});
+
+export default DiscoverUsers;