1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

search bar fixes

This commit is contained in:
Matthias Kretschmann 2020-10-31 00:55:39 +01:00
parent e95d8044c6
commit c92ec6bd94
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,7 @@
.form { .form {
margin-bottom: var(--spacer); margin-bottom: var(--spacer);
width: 100%;
max-width: 30rem;
} }
.form > div > div { .form > div > div {

View File

@ -8,11 +8,13 @@ import InputGroup from '../atoms/Input/InputGroup'
export default function SearchBar({ export default function SearchBar({
placeholder, placeholder,
initialValue, initialValue,
filters filters,
size
}: { }: {
placeholder?: string placeholder?: string
initialValue?: string initialValue?: string
filters?: boolean filters?: boolean
size?: 'small' | 'large'
}): ReactElement { }): ReactElement {
const navigate = useNavigate() const navigate = useNavigate()
const [value, setValue] = useState(initialValue || '') const [value, setValue] = useState(initialValue || '')
@ -37,6 +39,7 @@ export default function SearchBar({
value={value} value={value}
onChange={handleChange} onChange={handleChange}
required required
size={size}
/> />
<Button onClick={(e: FormEvent<HTMLButtonElement>) => startSearch(e)}> <Button onClick={(e: FormEvent<HTMLButtonElement>) => startSearch(e)}>
Search Search

View File

@ -82,7 +82,7 @@ export default function HomePage(): ReactElement {
return ( return (
<> <>
<Container narrow className={styles.searchWrap}> <Container narrow className={styles.searchWrap}>
<SearchBar /> <SearchBar size="large" />
</Container> </Container>
<section className={styles.latest}> <section className={styles.latest}>