feat: add icons to validator name and address

This commit is contained in:
RadoslavDimchev 2024-01-18 11:41:04 +02:00
parent ca7f8c7b78
commit bbbf821730
1 changed files with 17 additions and 6 deletions

View File

@ -1,24 +1,35 @@
import { Text } from '@status-im/components' import { Text } from '@status-im/components'
import { XStack, YStack } from 'tamagui' import { XStack, YStack } from 'tamagui'
import { CopyIcon, VerifiedIcon, ContactIcon } from '@status-im/icons'
import { getFormattedValidatorAddress } from '../../utilities' import { getFormattedValidatorAddress } from '../../utilities'
import { CopyIcon } from '@status-im/icons'
type ValidatorNameAddressProps = { type ValidatorNameAddressProps = {
number: number name: string
address: string address: string
isVerified?: boolean
isAvatarChipIncluded?: boolean
} }
const ValidatorNameAddress = ({ number, address }: ValidatorNameAddressProps) => { const ValidatorNameAddress = ({
name,
address,
isVerified,
isAvatarChipIncluded,
}: ValidatorNameAddressProps) => {
const onCopyAddress = () => { const onCopyAddress = () => {
navigator.clipboard.writeText(address) navigator.clipboard.writeText(address)
} }
return ( return (
<YStack alignItems={'start'}> <YStack alignItems={'start'}>
<Text size={15} weight={'semibold'}> <XStack space={'$1'} alignItems="center">
Validator {number} <Text size={13} weight={'semibold'}>
</Text> Validator {name}
</Text>
{isVerified && <VerifiedIcon size={20} />}
{isAvatarChipIncluded && <ContactIcon size={20} />}
</XStack>
<XStack space={'$1'} style={{ alignItems: 'center' }}> <XStack space={'$1'} style={{ alignItems: 'center' }}>
<Text size={13} color="#647084"> <Text size={13} color="#647084">
{getFormattedValidatorAddress(address)} {getFormattedValidatorAddress(address)}