From 2ca76e5656bd69119e82ca39000f8fcf1446fd40 Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Fri, 1 Sep 2023 01:11:13 +0300 Subject: [PATCH] select logo dynamically --- .../ValidatorSetup/ConsensusSelection.tsx | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/pages/ValidatorOnboarding/ValidatorSetup/ConsensusSelection.tsx b/src/pages/ValidatorOnboarding/ValidatorSetup/ConsensusSelection.tsx index 7ec5762b..25e283a1 100644 --- a/src/pages/ValidatorOnboarding/ValidatorSetup/ConsensusSelection.tsx +++ b/src/pages/ValidatorOnboarding/ValidatorSetup/ConsensusSelection.tsx @@ -8,12 +8,20 @@ import { useSelector } from 'react-redux' import { RootState } from '../../../redux/store' const ConsensusSelection = () => { - const selectedClient = useSelector((state: RootState) => state.execClient.selectedClient) + const selectedClient = useSelector((state: RootState) => state.execClient.selectedClient) as + + const clientIcons = { + Nethermind: '/icons/nethermind-circle.png', + Besu: '/icons/hyperledger-besu-circle.png', + Geth: '/icons/gethereum-mascot-circle.png', + Erigon: '/icons/erigon-circle.png', + Nimbus: '/icons/NimbusDisabled.svg', + } const a = [ { name: selectedClient, - icon: '/icons/Nimbus-black.png', // FIXL change icon based on selectedClient + icon: clientIcons[selectedClient], }, ] return ( @@ -57,10 +65,10 @@ const ConsensusSelection = () => { The resource efficient Ethereum Clients. - {selectedClient} is a client implementation for both execution and consensus layers that strives - to be as lightweight as possible in terms of resources used. This allows it to perform - well on embedded systems, resource-restricted devices -- including Raspberry Pis -- and - multi-purpose servers. + {selectedClient} is a client implementation for both execution and consensus layers that + strives to be as lightweight as possible in terms of resources used. This allows it to + perform well on embedded systems, resource-restricted devices -- including Raspberry Pis + -- and multi-purpose servers.