feat(validator): navigate to manage validator

This commit is contained in:
RadoslavDimchev 2024-03-23 16:39:43 +02:00 committed by Emil Ivanichkov
parent 098d7a8671
commit c72b6df587
1 changed files with 12 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import {
CheckIcon,
} from '@status-im/icons'
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { copyFunction, getFormattedValidatorAddress } from '../../utilities'
@ -24,6 +25,7 @@ const ValidatorNameAddress = ({
isAvatarChipIncluded,
}: ValidatorNameAddressProps) => {
const [isCopied, setIsCopied] = useState(false)
const navigate = useNavigate()
const onCopyAddress = () => {
copyFunction(address)
@ -37,9 +39,18 @@ const ValidatorNameAddress = ({
}
}
const onNavigateToManageValidator = () => {
navigate(`/manage-validator/${name}`)
}
return (
<YStack alignItems={'flex-start'}>
<XStack space={'$1'} alignItems="center">
<XStack
space={'$1'}
alignItems="center"
onPress={onNavigateToManageValidator}
cursor="pointer"
>
<Text size={13} weight={'semibold'}>
Validator {name}
</Text>