aboutsummaryrefslogtreecommitdiff
path: root/src/components/search/SuggestedSection.tsx
blob: af0323a5ebba19fb964c773c49aa770d45c8886b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react';
import {View, Text, ScrollView, StyleSheet} from 'react-native';
import SuggestedUser from './SuggestedUser';

/**
 * Search Screen for user recommendations and a search
 * tool to allow user to find other users
 */

interface SuggestedSectionProps {
  title: string;
  users: Array<string>;
}
const SuggestedSection: React.FC<SuggestedSectionProps> = ({title, users}) => {
  return (
    <View style={styles.container}>
      <Text style={styles.header}>{title}</Text>
      <ScrollView horizontal showsHorizontalScrollIndicator={false}>
        {users.map((name, key) => (
          <SuggestedUser {...{name, key}} style={styles.user} />
        ))}
      </ScrollView>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
    marginBottom: 30,
  },
  header: {
    fontWeight: '600',
    fontSize: 20,
    color: '#fff',
    marginBottom: 20,
  },
  user: {
    marginHorizontal: 15,
  },
});

export default SuggestedSection;