fix(validator-setting-card): icon function and component

This commit is contained in:
RadoslavDimchev 2024-03-23 16:56:13 +02:00 committed by Emil Ivanichkov
parent 0a0d83a989
commit 45005f0520

View File

@ -1,6 +1,7 @@
import { Text } from '@status-im/components' import { Text } from '@status-im/components'
import { DisconnectIcon, AdvancedIcon, ExternalIcon } from '@status-im/icons' import { DisconnectIcon, AdvancedIcon, ExternalIcon } from '@status-im/icons'
import { Stack, XStack, YStack } from 'tamagui' import { Stack, YStack } from 'tamagui'
type IconKey = 'Exit Validator' | 'Migrate Validator' | 'Advanced' type IconKey = 'Exit Validator' | 'Migrate Validator' | 'Advanced'
type ValidatorSettingCardProps = { type ValidatorSettingCardProps = {
@ -9,11 +10,11 @@ type ValidatorSettingCardProps = {
const ValidatorSettingCard = ({ title }: ValidatorSettingCardProps) => { const ValidatorSettingCard = ({ title }: ValidatorSettingCardProps) => {
const getIcon = { const getIcon = {
'Exit Validator': () => <DisconnectIcon size={20}></DisconnectIcon>, 'Exit Validator': <DisconnectIcon size={20} />,
'Migrate Validator': () => <ExternalIcon size={20}></ExternalIcon>, 'Migrate Validator': <ExternalIcon size={20} />,
Advanced: <AdvancedIcon size={20} />,
Advanced: () => <AdvancedIcon size={20}></AdvancedIcon>,
} }
return ( return (
<YStack alignItems="center"> <YStack alignItems="center">
<Stack <Stack
@ -24,7 +25,7 @@ const ValidatorSettingCard = ({ title }: ValidatorSettingCardProps) => {
width: 'fit-content', width: 'fit-content',
}} }}
> >
<XStack>{getIcon[title]()}</XStack> {getIcon[title]}
</Stack> </Stack>
<Text size={15} weight="semibold" color="#647084"> <Text size={15} weight="semibold" color="#647084">
{title} {title}