import React from 'react'; import { Pressable, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native'; import Avatar from './Avatar'; import { CustomIcon, TIconsName } from './CustomIcon'; import sharedStyles from '../views/Styles'; import { isIOS } from '../lib/methods/helpers'; import { useTheme } from '../theme'; 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: 16, ...sharedStyles.textMedium }, icon: { marginHorizontal: 15, alignSelf: 'center' } }); interface IUserItem { name: string; username: string; onPress(): void; testID: string; onLongPress?: () => void; style?: StyleProp; icon?: TIconsName | null; iconColor?: string; } const UserItem = ({ name, username, onPress, testID, onLongPress, style, icon, iconColor }: IUserItem) => { const { colors } = useTheme(); return ( ({ backgroundColor: isIOS && pressed ? colors.surfaceNeutral : 'transparent' })} > {name} {icon ? : null} ); }; export default UserItem;