diff --git a/src/components/UI/search/Search.tsx b/src/components/UI/search/Search.tsx index 27913e5e51..075de7cf37 100644 --- a/src/components/UI/search/Search.tsx +++ b/src/components/UI/search/Search.tsx @@ -1,29 +1,55 @@ -import { FC } from 'react'; -import { Input, InputGroup, Stack } from '@chakra-ui/react'; +import { FC, useState } from 'react'; +import { Input, InputGroup, Link, Stack } from '@chakra-ui/react'; import { BORDER_WIDTH } from '../../../constants'; import { LensIcon } from '../icons'; export const Search: FC = () => { + const [query, setQuery] = useState(''); + + // Handlers + const handleSubmit = (e: React.FormEvent): void => { + document.getElementById('search-link')?.click(); + }; + const handleKeyPress = (e: React.KeyboardEvent): void => { + if (e.key === 'Enter') handleSubmit(e); + }; + const handleChange = (e: React.ChangeEvent): void => { + setQuery(e.target.value); + }; + return ( + > - - - + + + );