Build search input

This commit is contained in:
Mosh Hamedani 2023-03-03 10:21:11 -08:00
parent c64514a5a6
commit 7c572a4560
3 changed files with 17 additions and 2 deletions

View file

@ -6,7 +6,7 @@ const ColorModeSwitch = () => {
return ( return (
<HStack> <HStack>
<Switch colorScheme='green' isChecked={colorMode === 'dark'} onChange={toggleColorMode} /> <Switch colorScheme='green' isChecked={colorMode === 'dark'} onChange={toggleColorMode} />
<Text>Dark Mode</Text> <Text whiteSpace='nowrap'>Dark Mode</Text>
</HStack> </HStack>
) )
} }

View file

@ -1,11 +1,13 @@
import { HStack, Image } from '@chakra-ui/react' import { HStack, Image } from '@chakra-ui/react'
import logo from '../assets/logo.webp'; import logo from '../assets/logo.webp';
import ColorModeSwitch from './ColorModeSwitch'; import ColorModeSwitch from './ColorModeSwitch';
import SearchInput from './SearchInput';
const NavBar = () => { const NavBar = () => {
return ( return (
<HStack justifyContent='space-between' padding='10px'> <HStack padding='10px'>
<Image src={logo} boxSize='60px' /> <Image src={logo} boxSize='60px' />
<SearchInput />
<ColorModeSwitch /> <ColorModeSwitch />
</HStack> </HStack>
) )

View file

@ -0,0 +1,13 @@
import { Input, InputGroup, InputLeftElement } from "@chakra-ui/react";
import { BsSearch } from "react-icons/bs";
const SearchInput = () => {
return (
<InputGroup>
<InputLeftElement children={<BsSearch />} />
<Input borderRadius={20} placeholder="Search games..." variant="filled" />
</InputGroup>
);
};
export default SearchInput;