mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-03 15:13:38 +00:00
feat: calculate currency value with name and symbol
This commit is contained in:
parent
30d58b9f8d
commit
91892295ae
@ -1,9 +1,10 @@
|
|||||||
|
import { useState } from 'react'
|
||||||
import { Button, DropdownMenu, Input, Text } from '@status-im/components'
|
import { Button, DropdownMenu, Input, Text } from '@status-im/components'
|
||||||
import { AddIcon, ChevronDownIcon, EditIcon } from '@status-im/icons'
|
import { AddIcon, ChevronDownIcon } from '@status-im/icons'
|
||||||
import { Stack, XStack, YStack } from 'tamagui'
|
import { Stack, XStack, YStack } from 'tamagui'
|
||||||
|
|
||||||
import DepositSubtitle from './DepositSubtitle'
|
import DepositSubtitle from './DepositSubtitle'
|
||||||
import { ETH_PER_VALIDATOR } from '../../../constants'
|
import { CURRENCIES, ETH_PER_VALIDATOR } from '../../../constants'
|
||||||
|
|
||||||
type ValidatorsProps = {
|
type ValidatorsProps = {
|
||||||
validatorCount: number
|
validatorCount: number
|
||||||
@ -16,6 +17,8 @@ const Validators = ({
|
|||||||
addValidatorHandler,
|
addValidatorHandler,
|
||||||
changeValidatorCountHandler,
|
changeValidatorCountHandler,
|
||||||
}: ValidatorsProps) => {
|
}: ValidatorsProps) => {
|
||||||
|
const [currency, setCurrency] = useState(CURRENCIES[0])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<XStack justifyContent={'space-between'} width={'80%'}>
|
<XStack justifyContent={'space-between'} width={'80%'}>
|
||||||
<Stack space={'$2'}>
|
<Stack space={'$2'}>
|
||||||
@ -54,7 +57,8 @@ const Validators = ({
|
|||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</XStack>
|
</XStack>
|
||||||
<Text size={27} weight={'semibold'}>
|
<Text size={27} weight={'semibold'}>
|
||||||
$4,273 USD
|
{currency.symbol}
|
||||||
|
{validatorCount * currency.price} {currency.name}
|
||||||
</Text>
|
</Text>
|
||||||
</YStack>
|
</YStack>
|
||||||
</XStack>
|
</XStack>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user