aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Followers.tsx
blob: 6f56c03c79ec50c2af28286d26b307c2b528f0a4 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import React from 'react';
import {View, StyleSheet, ViewProps, Text} from 'react-native';
import {ProfilePreviewType} from '../../types';
import {ProfilePreview} from '..';
import {useNavigation} from '@react-navigation/native';
import {Button} from 'react-native-elements';

interface FollowersListProps {
  result: Array<ProfilePreviewType>;
  sectionTitle: string;
}

const Followers: React.FC<FollowersListProps> = ({result, sectionTitle}) => {
  const navigation = useNavigation();
  return (
    <>
      <View style={styles.header}>
        <Button
          title="X"
          buttonStyle={styles.button}
          titleStyle={styles.buttonText}
          onPress={() => {
            navigation.pop();
          }}
        />
        <Text style={styles.title}>{sectionTitle}</Text>
      </View>
      {result.map((profilePreview) => (
        <ProfilePreview
          style={styles.follower}
          key={profilePreview.id}
          {...{profilePreview}}
          isComment={true}
        />
      ))}
    </>
  );
};

const styles = StyleSheet.create({
  header: {flexDirection: 'row'},
  follower: {
    marginVertical: 10,
  },
  title: {
    position: 'relative',
    fontSize: 17,
    fontWeight: 'bold',
    paddingBottom: 10,
    paddingTop: 10,
    flexGrow: 1,
    paddingLeft: '26%',
  },
  button: {
    backgroundColor: 'transparent',
  },
  buttonText: {
    color: 'black',
    fontSize: 18,
    fontWeight: '400',
  },
});

export default Followers;