import React from 'react'; import { Pressable, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native'; import Avatar from './Avatar'; import { CustomIcon } from '../lib/Icons'; import sharedStyles from '../views/Styles'; import { themes } from '../lib/constants'; import { isIOS } from '../utils/deviceInfo'; const styles = StyleSheet.create({ button: { height: 54 }, container: { flexDirection: 'row' }, avatar: { marginHorizontal: 15, marginVertical: 12 }, textContainer: { flex: 1, flexDirection: 'column', justifyContent: 'center', marginRight: 15 }, name: { fontSize: 17, ...sharedStyles.textMedium }, username: { fontSize: 14, ...sharedStyles.textRegular }, icon: { marginHorizontal: 15, alignSelf: 'center' } }); interface IUserItem { name: string; username: string; onPress(): void; testID: string; onLongPress?: () => void; style?: StyleProp; icon?: string | null; theme: string; } const UserItem = ({ name, username, onPress, testID, onLongPress, style, icon, theme }: IUserItem) => ( ({ backgroundColor: isIOS && pressed ? themes[theme].bannerBackground : 'transparent' })}> {name} @{username} {icon ? : null} ); export default UserItem;