mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-13 11:56:26 +00:00
feat: create state for open key generation sync card
This commit is contained in:
parent
715c815d5f
commit
691bc01c42
@ -1,6 +1,7 @@
|
|||||||
import { Stack, XStack, YStack } from 'tamagui'
|
import { Stack, XStack, YStack } from 'tamagui'
|
||||||
import { ClearIcon } from '@status-im/icons'
|
import { ClearIcon } from '@status-im/icons'
|
||||||
import { Text } from '@status-im/components'
|
import { Text } from '@status-im/components'
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
import StandardGauge from '../../../../components/Charts/StandardGauge'
|
import StandardGauge from '../../../../components/Charts/StandardGauge'
|
||||||
import BorderBox from '../../../../components/General/BorderBox'
|
import BorderBox from '../../../../components/General/BorderBox'
|
||||||
@ -14,6 +15,16 @@ type KeyGenerationSyncCardProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const KeyGenerationSyncCard = ({ synced, total, title, color }: KeyGenerationSyncCardProps) => {
|
const KeyGenerationSyncCard = ({ synced, total, title, color }: KeyGenerationSyncCardProps) => {
|
||||||
|
const [isOpen, setIsOpen] = useState(true)
|
||||||
|
|
||||||
|
const closeCardHanlder = () => {
|
||||||
|
setIsOpen(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isOpen === false) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BorderBox style={{ borderRadius: '10.1px', borderWidth: '0.5px' }}>
|
<BorderBox style={{ borderRadius: '10.1px', borderWidth: '0.5px' }}>
|
||||||
<XStack space={'$2'} alignItems="center">
|
<XStack space={'$2'} alignItems="center">
|
||||||
@ -48,7 +59,12 @@ const KeyGenerationSyncCard = ({ synced, total, title, color }: KeyGenerationSyn
|
|||||||
{formatNumberForGauge(synced)} / {formatNumberForGauge(total)}
|
{formatNumberForGauge(synced)} / {formatNumberForGauge(total)}
|
||||||
</Text>
|
</Text>
|
||||||
</YStack>
|
</YStack>
|
||||||
<ClearIcon size={20} color="#A1ABBD" />
|
<ClearIcon
|
||||||
|
size={20}
|
||||||
|
color="#A1ABBD"
|
||||||
|
onClick={closeCardHanlder}
|
||||||
|
style={{ cursor: 'pointer' }}
|
||||||
|
/>
|
||||||
</XStack>
|
</XStack>
|
||||||
</BorderBox>
|
</BorderBox>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user