fix: vaidator list item tweaks
This commit is contained in:
parent
2a81f11c59
commit
6c6d77b13a
|
@ -2,6 +2,7 @@ import { useState } from 'react'
|
||||||
import { XStack, YStack } from 'tamagui'
|
import { XStack, YStack } from 'tamagui'
|
||||||
import { Avatar, Checkbox, Text } from '@status-im/components'
|
import { Avatar, Checkbox, Text } from '@status-im/components'
|
||||||
import { VerifiedIcon, ContactIcon } from '@status-im/icons'
|
import { VerifiedIcon, ContactIcon } from '@status-im/icons'
|
||||||
|
|
||||||
import { getFormattedValidatorAddress } from '../../../../utilities'
|
import { getFormattedValidatorAddress } from '../../../../utilities'
|
||||||
|
|
||||||
type ValidatorListItemProps = {
|
type ValidatorListItemProps = {
|
||||||
|
@ -19,14 +20,14 @@ const ValidatorListItem = ({
|
||||||
isAvatarChipIncluded,
|
isAvatarChipIncluded,
|
||||||
isVerified,
|
isVerified,
|
||||||
}: ValidatorListItemProps) => {
|
}: ValidatorListItemProps) => {
|
||||||
const [hovered, setHovered] = useState(false)
|
const [isHovered, setIsHovered] = useState(false)
|
||||||
const [isSelected, setIsSelected] = useState(selected)
|
const [isSelected, setIsSelected] = useState(selected)
|
||||||
|
|
||||||
const handleMouseEnter = () => setHovered(true)
|
const handleMouseEnter = () => setIsHovered(true)
|
||||||
const handleMouseLeave = () => setHovered(false)
|
const handleMouseLeave = () => setIsHovered(false)
|
||||||
const handleClick = () => setIsSelected(!isSelected)
|
const handleClick = () => setIsSelected(!isSelected)
|
||||||
|
|
||||||
const backgroundColor = isSelected || hovered ? 'rgba(42, 74, 245, 0.05)' : 'transparent'
|
const backgroundColor = isSelected || isHovered ? 'rgba(42, 74, 245, 0.05)' : 'transparent'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<XStack
|
<XStack
|
||||||
|
@ -38,7 +39,7 @@ const ValidatorListItem = ({
|
||||||
style={{
|
style={{
|
||||||
padding: '6px 8px',
|
padding: '6px 8px',
|
||||||
borderRadius: '12px',
|
borderRadius: '12px',
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor,
|
||||||
}}
|
}}
|
||||||
width="90%"
|
width="90%"
|
||||||
>
|
>
|
||||||
|
@ -58,7 +59,7 @@ const ValidatorListItem = ({
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<YStack pl="8px">
|
<YStack pl="8px">
|
||||||
<XStack space={'$2'} alignItems="center">
|
<XStack space={'$1'} alignItems="center">
|
||||||
<Text size={13} weight={'semibold'}>
|
<Text size={13} weight={'semibold'}>
|
||||||
{name}
|
{name}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
Loading…
Reference in New Issue