aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Friends.tsx
blob: 23ce28fe179b48bc6bff106e7c7f1b9c85ea886d (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
65
import React from 'react';
import {View, StyleSheet, Text} from 'react-native';
import {ProfilePreviewType, ScreenType} from '../../types';
import {ProfilePreview} from '..';
import {useNavigation} from '@react-navigation/native';
import {Button} from 'react-native-elements';

interface FriendsProps {
  result: Array<ProfilePreviewType>;
  screenType: ScreenType;
}

const Friends: React.FC<FriendsProps> = ({result, screenType}) => {
  const navigation = useNavigation();
  return (
    <>
      <View style={styles.header}>
        <Button
          title="X"
          buttonStyle={styles.button}
          titleStyle={styles.buttonText}
          onPress={() => {
            navigation.pop();
          }}
        />
        <Text style={styles.title}>Friends</Text>
      </View>
      {result.map((profilePreview) => (
        <ProfilePreview
          style={styles.friend}
          key={profilePreview.id}
          {...{profilePreview}}
          previewType={'Friend'}
          screenType={screenType}
        />
      ))}
    </>
  );
};

const styles = StyleSheet.create({
  header: {flexDirection: 'row'},
  friend: {
    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 Friends;