diff --git a/src/Components/Product/Filters.jsx b/src/Components/Product/Filters.jsx new file mode 100644 index 00000000..51c8ef17 --- /dev/null +++ b/src/Components/Product/Filters.jsx @@ -0,0 +1,51 @@ +import React, { useContext } from 'react'; + +import { GlobalState } from '../../GlobalState'; + +function Filters() { + const state = useContext(GlobalState) + const [products, setProducts] = state.productsAPI.products + const [categories] = state.productsAPI.categories + const [category, setCategory] = state.productsAPI.category + const [sort, setSort] = state.productsAPI.sort + const [search, setSearch] = state.productsAPI.search + + + const handleCategory = e => { + setCategory(e.target.value) + setSearch('') + } + + return ( +
+
+ Filters: + +
+ setSearch(e.target.value.toLowerCase())} + /> +
+ Sort By: + +
+
+ ) +} + +export default Filters;