select logo dynamically

This commit is contained in:
Hristo Nedelkov 2023-09-01 01:11:13 +03:00
parent 11fe8cd905
commit 2ca76e5656
1 changed files with 14 additions and 6 deletions

View File

@ -8,12 +8,20 @@ import { useSelector } from 'react-redux'
import { RootState } from '../../../redux/store' import { RootState } from '../../../redux/store'
const ConsensusSelection = () => { 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 = [ const a = [
{ {
name: selectedClient, name: selectedClient,
icon: '/icons/Nimbus-black.png', // FIXL change icon based on selectedClient icon: clientIcons[selectedClient],
}, },
] ]
return ( return (
@ -57,10 +65,10 @@ const ConsensusSelection = () => {
<YStack width={'67%'} space={'$4'}> <YStack width={'67%'} space={'$4'}>
<Text size={27}>The resource efficient Ethereum Clients.</Text> <Text size={27}>The resource efficient Ethereum Clients.</Text>
<Text size={15}> <Text size={15}>
{selectedClient} is a client implementation for both execution and consensus layers that strives {selectedClient} is a client implementation for both execution and consensus layers that
to be as lightweight as possible in terms of resources used. This allows it to perform strives to be as lightweight as possible in terms of resources used. This allows it to
well on embedded systems, resource-restricted devices -- including Raspberry Pis -- and perform well on embedded systems, resource-restricted devices -- including Raspberry Pis
multi-purpose servers. -- and multi-purpose servers.
</Text> </Text>
<Text size={19} weight={'semibold'}> <Text size={19} weight={'semibold'}>
<LinkWithArrow <LinkWithArrow