forked from M-Labs/web2019
19 lines
656 B
React
19 lines
656 B
React
|
import React from 'react';
|
||
|
import {useShopStore} from "./shop_store";
|
||
|
|
||
|
export function SearchBar() {
|
||
|
const search_bar_value = useShopStore((state) => state.search_bar_value);
|
||
|
const updateSearchBar = useShopStore((state) => state.updateSearchBar);
|
||
|
|
||
|
return (
|
||
|
<div className="form-outline">
|
||
|
<input type="search"
|
||
|
id="search_bar"
|
||
|
className="form-control"
|
||
|
placeholder="Search through cards"
|
||
|
value={search_bar_value}
|
||
|
onChange={event => updateSearchBar(event.target.value)}
|
||
|
aria-label="Search"/>
|
||
|
</div>
|
||
|
)
|
||
|
}
|