aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/SearchForm/SearchForm.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-07 19:16:46 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-07 19:37:30 +0100
commit1007c6689e7b549f48013d2c29eac9c78f13dfb7 (patch)
tree832970f5e4443249f561d547e2c6864704712577 /src/components/SearchForm/SearchForm.tsx
parent9a85c175bf59b7a360f09da23a3ac83293838570 (diff)
chore: improve search box and add button interactions on hover/focus
Diffstat (limited to 'src/components/SearchForm/SearchForm.tsx')
-rw-r--r--src/components/SearchForm/SearchForm.tsx30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/components/SearchForm/SearchForm.tsx b/src/components/SearchForm/SearchForm.tsx
index e37ba9e..c1a7ca7 100644
--- a/src/components/SearchForm/SearchForm.tsx
+++ b/src/components/SearchForm/SearchForm.tsx
@@ -1,8 +1,10 @@
import { ButtonSubmit } from '@components/Buttons';
import { Form, Input } from '@components/Form';
+import { SearchIcon } from '@components/Icons';
import { t } from '@lingui/macro';
import { useRouter } from 'next/router';
import { FormEvent, useEffect, useRef, useState } from 'react';
+import styles from './SearchForm.module.scss';
const SearchForm = ({ isOpened }: { isOpened: boolean }) => {
const [query, setQuery] = useState('');
@@ -24,17 +26,23 @@ const SearchForm = ({ isOpened }: { isOpened: boolean }) => {
};
return (
- <Form submitHandler={launchSearch} modifier="search">
- <Input
- ref={inputRef}
- id="search-query"
- name="search-query"
- type="search"
- value={query}
- setValue={setQuery}
- />
- <ButtonSubmit>{t`Search`}</ButtonSubmit>
- </Form>
+ <>
+ <div className={styles.title}>{t`Search`}</div>
+ <Form submitHandler={launchSearch} modifier="search">
+ <Input
+ ref={inputRef}
+ id="search-query"
+ name="search-query"
+ type="search"
+ value={query}
+ setValue={setQuery}
+ />
+ <ButtonSubmit modifier="search">
+ <SearchIcon />
+ <span className="screen-reader-text">{t`Search`}</span>
+ </ButtonSubmit>
+ </Form>
+ </>
);
};