feat: create reuse component for validator name and address
This commit is contained in:
parent
c5eb85b018
commit
4dbf4d3e8a
|
@ -0,0 +1,32 @@
|
|||
import { Text } from '@status-im/components'
|
||||
import { XStack, YStack } from 'tamagui'
|
||||
|
||||
import { getFormattedValidatorAddress } from '../../utilities'
|
||||
import { CopyIcon } from '@status-im/icons'
|
||||
|
||||
type ValidatorNameAddressProps = {
|
||||
number: number
|
||||
address: string
|
||||
}
|
||||
|
||||
const ValidatorNameAddress = ({ number, address }: ValidatorNameAddressProps) => {
|
||||
const onCopyAddress = () => {
|
||||
navigator.clipboard.writeText(address)
|
||||
}
|
||||
|
||||
return (
|
||||
<YStack>
|
||||
<Text size={15} weight={'semibold'}>
|
||||
Validator {number}
|
||||
</Text>
|
||||
<XStack space={'$1'} style={{ alignItems: 'center' }}>
|
||||
<Text size={13} color="#647084">
|
||||
{getFormattedValidatorAddress(address)}
|
||||
</Text>
|
||||
<CopyIcon size={16} color="#647084" style={{ cursor: 'pointer' }} onClick={onCopyAddress} />
|
||||
</XStack>
|
||||
</YStack>
|
||||
)
|
||||
}
|
||||
|
||||
export default ValidatorNameAddress
|
Loading…
Reference in New Issue