feat: add copy address handler

This commit is contained in:
RadoslavDimchev 2024-01-17 08:58:29 +02:00
parent a66b08f21a
commit c5eb85b018

View File

@ -10,6 +10,10 @@ type ValidatorProfileProps = {
}
const ValidatorProfile = ({ number, address }: ValidatorProfileProps) => {
const onCopyAddress = () => {
navigator.clipboard.writeText(address)
}
return (
<XStack space={'$2'}>
<Avatar
@ -27,7 +31,12 @@ const ValidatorProfile = ({ number, address }: ValidatorProfileProps) => {
<Text size={13} color="#647084">
{getFormattedValidatorAddress(address)}
</Text>
<CopyIcon size={16} color="#647084" style={{ cursor: 'pointer' }} />
<CopyIcon
size={16}
color="#647084"
style={{ cursor: 'pointer' }}
onClick={onCopyAddress}
/>
</XStack>
</YStack>
</XStack>