aboutsummaryrefslogtreecommitdiff
path: root/src/components/common/TaggUserRowCell.tsx
blob: 446dedc9853c3d130b5885a9b332f5902820367f (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
import React from 'react';
import {StyleSheet, Text, TouchableOpacity, View} from 'react-native';
import {ProfilePreviewType} from '../../types';
import {normalize} from '../../utils';
import Avatar from './Avatar';

type TaggUserRowCellProps = {
  onPress: () => void;
  user: ProfilePreviewType;
};
const TaggUserRowCell: React.FC<TaggUserRowCellProps> = ({onPress, user}) => {
  return (
    <TouchableOpacity onPress={onPress} style={styles.container}>
      <Avatar style={styles.image} uri={user.thumbnail_url} />
      <View style={styles.textContent}>
        <Text style={styles.username}>{`@${user.username}`}</Text>
        <Text style={styles.name}>
          {user.first_name} {user.last_name}
        </Text>
      </View>
    </TouchableOpacity>
  );
};

const styles = StyleSheet.create({
  container: {
    flexDirection: 'row',
    paddingHorizontal: 25,
    paddingVertical: 15,
    width: '100%',
  },
  image: {
    width: normalize(30),
    height: normalize(30),
    borderRadius: 30,
  },
  textContent: {
    flexDirection: 'column',
    justifyContent: 'space-between',
    marginLeft: 20,
  },
  username: {
    fontWeight: '500',
    fontSize: normalize(14),
  },
  name: {
    fontWeight: '500',
    fontSize: normalize(12),
    color: '#828282',
  },
});
export default TaggUserRowCell;