feat: add colors to sync cards
This commit is contained in:
parent
7a1b16759e
commit
f64d7e5c63
|
@ -7,8 +7,18 @@ const KeyGenerationHeader = () => {
|
||||||
<XStack style={{ width: '100%', alignItems: 'center', justifyContent: 'space-between' }}>
|
<XStack style={{ width: '100%', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||||
<KeyGenerationTitle />
|
<KeyGenerationTitle />
|
||||||
<XStack space={'$2'}>
|
<XStack space={'$2'}>
|
||||||
<KeyGenerationSyncCard synced={123.524} total={172.503} title="Execution Sync Status" />
|
<KeyGenerationSyncCard
|
||||||
<KeyGenerationSyncCard synced={123.524} total={172.503} title="Consensus Sync Status" />
|
synced={123.524}
|
||||||
|
total={172.503}
|
||||||
|
title="Execution Sync Status"
|
||||||
|
color="#2a4af5"
|
||||||
|
/>
|
||||||
|
<KeyGenerationSyncCard
|
||||||
|
synced={123.524}
|
||||||
|
total={172.503}
|
||||||
|
title="Consensus Sync Status"
|
||||||
|
color="#ff6161"
|
||||||
|
/>
|
||||||
</XStack>
|
</XStack>
|
||||||
</XStack>
|
</XStack>
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,26 +7,10 @@ type KeyGenerationSyncCardProps = {
|
||||||
synced: number
|
synced: number
|
||||||
total: number
|
total: number
|
||||||
title: string
|
title: string
|
||||||
|
color: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const KeyGenerationSyncCard = ({ synced, total, title }: KeyGenerationSyncCardProps) => {
|
const KeyGenerationSyncCard = ({ synced, total, title, color }: KeyGenerationSyncCardProps) => {
|
||||||
const data = () => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
id: 'storage',
|
|
||||||
label: 'Used',
|
|
||||||
value: synced,
|
|
||||||
color: '#2a4af5',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'storage',
|
|
||||||
label: 'Free',
|
|
||||||
value: total - synced || 1,
|
|
||||||
color: '#E7EAEE',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<XStack
|
<XStack
|
||||||
space={'$2'}
|
space={'$2'}
|
||||||
|
@ -39,7 +23,22 @@ const KeyGenerationSyncCard = ({ synced, total, title }: KeyGenerationSyncCardPr
|
||||||
width: '35px',
|
width: '35px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<StandardGauge data={data()} />
|
<StandardGauge
|
||||||
|
data={[
|
||||||
|
{
|
||||||
|
id: 'storage',
|
||||||
|
label: 'Used',
|
||||||
|
value: synced,
|
||||||
|
color: color,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'storage',
|
||||||
|
label: 'Free',
|
||||||
|
value: total - synced || 1,
|
||||||
|
color: '#E7EAEE',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<YStack>
|
<YStack>
|
||||||
<Text size={11} color="#84888e" weight={'semibold'}>
|
<Text size={11} color="#84888e" weight={'semibold'}>
|
||||||
|
|
Loading…
Reference in New Issue