feat(validator peers cards): implement new validator peers cards

This commit is contained in:
Hristo Nedelkov 2024-03-08 16:38:11 +02:00
parent ebe8c7ee70
commit 75191deffb
4 changed files with 25 additions and 12 deletions

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -1,30 +1,40 @@
import { Text } from '@status-im/components' import { Text } from '@status-im/components'
import { Stack, YStack } from 'tamagui' import { Stack, XStack, YStack } from 'tamagui'
import Icon from '../../../components/General/Icon'
type ValidatorDataCardProps = { type ValidatorDataCardProps = {
title: string title: string
value: string value: string
iconPath: string
} }
const ValidatorDataCard = ({ title, value }: ValidatorDataCardProps) => { const ValidatorDataCard = ({
title,
value,
iconPath,
}: ValidatorDataCardProps) => {
return ( return (
<Stack <XStack
style={{ style={{
border: '0.5px solid #DCE0E5', border: '0.5px solid #DCE0E5',
flexGrow: '1', flexGrow: '1',
borderRadius: '16px', borderRadius: '16px',
padding: '10px', padding: '10px',
alignContent: 'center',
alignItems: 'center',
}} }}
space="$3"
> >
<Icon src={`/icons/${iconPath}`} width={35} height={35}></Icon>
<YStack> <YStack>
<Text size={15} weight={'semibold'}> <Text size={13} weight={'semibold'} color="#647084">
{title} {title}
</Text> </Text>
<Text size={27} weight={'semibold'}> <Text size={19} weight={'semibold'}>
{value} {value}
</Text> </Text>
</YStack> </YStack>
</Stack> </XStack>
) )
} }

View File

@ -15,11 +15,14 @@ const ValidatorDataCards = () => {
}} }}
> >
<ValidatorPeersCard title="Peers" value="67"></ValidatorPeersCard> <ValidatorPeersCard title="Peers" value="67"></ValidatorPeersCard>
<ValidatorDataCard title="Blocks" value="1" /> <ValidatorDataCard title="Blocks" value="1" iconPath="ghost.png" />
<ValidatorDataCard title="Attestations" value="1452" /> <ValidatorDataCard
<ValidatorDataCard title="Syncs" value="45" /> title="Attestations"
<ValidatorDataCard title="Deposits" value="1" /> value="1452"
<ValidatorDataCard title="Withdrawals" value="0" /> iconPath="rubiks-cube.png"
/>
<ValidatorDataCard title="Syncs" value="45" iconPath="pacman.png" />
<ValidatorDataCard title="Deposits" value="1" iconPath="toaster.png" />
</Stack> </Stack>
) )
} }

View File

@ -47,7 +47,7 @@ const ValidatorPeersCard = ({ title, value }: ValidatorPeersCardProps) => {
<ValidatorPeersPieChart data={PeersPieData} /> <ValidatorPeersPieChart data={PeersPieData} />
</Stack> </Stack>
<YStack> <YStack>
<Text size={15} weight={'semibold'}> <Text size={13} weight={'semibold'} color="#647084">
{title} {title}
</Text> </Text>
<Text size={27} weight={'semibold'}> <Text size={27} weight={'semibold'}>