fix: use MAC constant instead of string

This commit is contained in:
RadoslavDimchev 2023-10-23 20:35:01 +03:00
parent d8793c48b1
commit 3e1fe715e3
4 changed files with 10 additions and 9 deletions

View File

@ -31,6 +31,7 @@ export const KEYSTORE_FILES = 'KeystoreFiles'
export const RECOVERY_PHRASE = 'Recovery Phrase'
export const BOTH_KEY_AND_RECOVERY = 'Both KeystoreFiles & Recovery Phrase'
export const ETH_PER_VALIDATOR = 32
export const MAC = 'Mac'
export const WINDOWS = 'Windows'
export const LINUX = 'Linux'

View File

@ -2,18 +2,18 @@ import { XStack } from 'tamagui'
import { useState } from 'react'
import OSCard from './OSCard'
import { LINUX, WINDOWS } from '../../../../constants'
import { LINUX, MAC, WINDOWS } from '../../../../constants'
const OSCards = () => {
const [selectedOs, setSelectedOs] = useState('MAC')
const [selectedOs, setSelectedOs] = useState(MAC)
return (
<XStack justifyContent={'space-between'} my={'15px'}>
<OSCard
icon="/icons/apple-logo.svg"
name="MacOS"
isSelected={selectedOs === 'MAC'}
onClick={() => setSelectedOs('MAC')}
isSelected={selectedOs === MAC}
onClick={() => setSelectedOs(MAC)}
/>
<OSCard
icon="/icons/linux-logo.svg"

View File

@ -14,7 +14,7 @@ type Story = StoryObj<typeof meta>
export const Default: Story = {
args: {
icon: '/icons/apple-logo.svg',
name: 'MAC',
name: MAC,
isSelected: true,
},
}

View File

@ -6,11 +6,11 @@ import { useSelector } from 'react-redux'
import SyntaxHighlighterBox from './SyntaxHighlighter'
import { RootState } from '../../../../redux/store'
import { LINUX, WINDOWS } from '../../../../constants'
import { LINUX, MAC, WINDOWS } from '../../../../constants'
import OSCard from './OSCard'
const ValidatorSetupInstall = () => {
const [selectedOs, setSelectedOs] = useState('MAC')
const [selectedOs, setSelectedOs] = useState(MAC)
const selectedClient = useSelector((state: RootState) => state.execClient.selectedClient)
return (
@ -60,8 +60,8 @@ const ValidatorSetupInstall = () => {
<OSCard
icon="/icons/apple-logo.svg"
name="MacOS"
isSelected={selectedOs === 'MAC'}
onClick={() => setSelectedOs('MAC')}
isSelected={selectedOs === MAC}
onClick={() => setSelectedOs(MAC)}
/>
<OSCard
icon="/icons/linux-logo.svg"