diff options
author | Ivan Chen <ivan@tagg.id> | 2021-05-07 16:01:47 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-05-07 16:01:47 -0400 |
commit | 76bc8c5825f39257be6e7648d12b858f1e805569 (patch) | |
tree | b94d9570439ebfa42e6664144f124abe5d4113e3 /src/components/common/TaggUserRowCell.tsx | |
parent | 65c7411f4609edac3d4d5f23fc031ed274fc5872 (diff) | |
parent | c9d32e68fbb9d1bc175722bfda49454a6f627eae (diff) |
Merge branch 'master' into tma821-load-badges-faster-ft
# Conflicts:
# src/utils/users.ts
Diffstat (limited to 'src/components/common/TaggUserRowCell.tsx')
-rw-r--r-- | src/components/common/TaggUserRowCell.tsx | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/components/common/TaggUserRowCell.tsx b/src/components/common/TaggUserRowCell.tsx new file mode 100644 index 00000000..446dedc9 --- /dev/null +++ b/src/components/common/TaggUserRowCell.tsx @@ -0,0 +1,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; |