Add icons logic in ValidatorListItem

This commit is contained in:
Hristo Nedelkov 2023-09-27 11:24:57 +03:00
parent a7b947afe5
commit d900076202
1 changed files with 10 additions and 2 deletions

View File

@ -6,10 +6,13 @@ import { VerifiedIcon, ContactIcon } from '@status-im/icons';
type ValidatorListItemProps = { type ValidatorListItemProps = {
name: string; name: string;
avatarKey: string; avatarKey: string;
isAvatarChipIncluded?: boolean;
isVerified?: boolean;
selected?: boolean; selected?: boolean;
}; };
const ValidatorListItem = ({ name, avatarKey, selected }: ValidatorListItemProps) => { const ValidatorListItem = ({ name, avatarKey, selected, isAvatarChipIncluded, isVerified }: ValidatorListItemProps) => {
const [hovered, setHovered] = useState(false); const [hovered, setHovered] = useState(false);
const [isSelected, setIsSelected] = useState(selected); const [isSelected, setIsSelected] = useState(selected);
@ -51,7 +54,12 @@ const ValidatorListItem = ({ name, avatarKey, selected }: ValidatorListItemProps
<YStack pl="8px"> <YStack pl="8px">
<Text size={13} weight={'semibold'}> <Text size={13} weight={'semibold'}>
{name} {name}
<VerifiedIcon size={20} /> <ContactIcon size={20} /> {isVerified && (
<VerifiedIcon size={20} />
)}
{isAvatarChipIncluded && (
<ContactIcon size={20} />
)}
</Text> </Text>
<Text size={13}>{avatarKey}</Text> <Text size={13}>{avatarKey}</Text>
</YStack> </YStack>