updated searchbar to retain state on refresh
All checks were successful
Vercel Production Deployment / Deploy-Production (push) Successful in 1m18s
All checks were successful
Vercel Production Deployment / Deploy-Production (push) Successful in 1m18s
This commit is contained in:
parent
a61a65aab0
commit
ef08c000ec
@ -4,13 +4,14 @@ import { Input } from "~/components/ui/input";
|
|||||||
import useFilterStore from "../store";
|
import useFilterStore from "../store";
|
||||||
|
|
||||||
export default function SearchBar() {
|
export default function SearchBar() {
|
||||||
const [searchQuery, setSearchQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
const setStoreSearchQuery = useFilterStore((state) => state.setSearchQuery);
|
const setStoreSearchQuery = useFilterStore((state) => state.setSearchQuery);
|
||||||
|
const { searchQuery } = useFilterStore((state) => state.filters);
|
||||||
|
|
||||||
function handleInput(e: ChangeEvent<HTMLInputElement>) {
|
function handleInput(e: ChangeEvent<HTMLInputElement>) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const newValue = e.target.value;
|
const newValue = e.target.value;
|
||||||
setSearchQuery(newValue);
|
setQuery(newValue);
|
||||||
setStoreSearchQuery(newValue);
|
setStoreSearchQuery(newValue);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user