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