From 19f7266598d779ec46279346283666e779254ac0 Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Mon, 25 Mar 2024 22:15:14 +0200 Subject: [PATCH] feat(validator-setting-card): card constants --- .../LeftManage/ValidatorSettingCard.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/ManageValidator/LeftManage/ValidatorSettingCard.tsx b/src/pages/ManageValidator/LeftManage/ValidatorSettingCard.tsx index 1a7b1765..4f95eb3b 100644 --- a/src/pages/ManageValidator/LeftManage/ValidatorSettingCard.tsx +++ b/src/pages/ManageValidator/LeftManage/ValidatorSettingCard.tsx @@ -3,18 +3,20 @@ import { DisconnectIcon, AdvancedIcon, ExternalIcon } from '@status-im/icons' import { useNavigate } from 'react-router-dom' import { Stack, YStack } from 'tamagui' -type IconKey = 'Exit Validator' | 'Migrate Validator' | 'Advanced' +import { CARD_TITLES } from '../../../constants' + +type CardTitle = (typeof CARD_TITLES)[number] type ValidatorSettingCardProps = { - title: IconKey + title: CardTitle } const ValidatorSettingCard = ({ title }: ValidatorSettingCardProps) => { const navigate = useNavigate() const getIcon = { - 'Exit Validator': , - 'Migrate Validator': , + Exit: , + Migrate: , Advanced: , } @@ -35,7 +37,7 @@ const ValidatorSettingCard = ({ title }: ValidatorSettingCardProps) => { width: 'fit-content', }} > - {getIcon[title]} + {getIcon[title as keyof typeof getIcon]} {title}