feat: create separated OS cards component

This commit is contained in:
RadoslavDimchev 2023-10-23 20:33:47 +03:00
parent 15aed4d924
commit d8793c48b1
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
import { XStack } from 'tamagui'
import { useState } from 'react'
import OSCard from './OSCard'
import { LINUX, WINDOWS } from '../../../../constants'
const OSCards = () => {
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')}
/>
<OSCard
icon="/icons/linux-logo.svg"
name={LINUX}
isSelected={selectedOs === LINUX}
onClick={() => setSelectedOs(LINUX)}
/>
<OSCard
icon="/icons/windows-logo.svg"
name={WINDOWS}
isSelected={selectedOs === WINDOWS}
onClick={() => setSelectedOs(WINDOWS)}
/>
</XStack>
)
}
export default OSCards