diff --git a/frontend/src/components/SearchBar.tsx b/frontend/src/components/SearchBar.tsx index 31c48a63..9ba71988 100644 --- a/frontend/src/components/SearchBar.tsx +++ b/frontend/src/components/SearchBar.tsx @@ -3,11 +3,14 @@ import { Button } from "./ui/button"; import { Input } from "./ui/input"; import { Search } from "lucide-react"; import { useId, useState } from "react"; +import SearchFilterPopover from "./SearchFilterPopover"; export const SearchBar = () => { const id = useId(); const [params] = useSearchParams(); const [search, setSearch] = useState(params.get("q") || ""); + const [cuisine, setCuisine] = useState(params.get("cuisine") || ""); + const [foodType, setFoodType] = useState(params.get("foodType") || ""); const navigate = useNavigate(); @@ -29,6 +32,12 @@ export const SearchBar = () => { id={id} name="search" /> + + + + + + +

Filter

+
+
Cuisine
+
+ + setTempCuisine(e.target.checked ? "Italian" : "") + } + /> + + setTempCuisine(e.target.checked ? "Chinese" : "") + } + /> + + setTempCuisine(e.target.checked ? "Japanese" : "") + } + /> + + setTempCuisine(e.target.checked ? "Turkish" : "") + } + /> +
+
+
+
Type of Food
+
+ setTempFoodType(e.target.checked ? "Meat" : "")} + /> + setTempFoodType(e.target.checked ? "Baked" : "")} + /> + setTempFoodType(e.target.checked ? "Dairy" : "")} + /> + setTempFoodType(e.target.checked ? "Eggs" : "")} + /> +
+
+ + + +
+ + ); +} diff --git a/frontend/src/components/ui/popover.tsx b/frontend/src/components/ui/popover.tsx index 59dd5252..643da896 100644 --- a/frontend/src/components/ui/popover.tsx +++ b/frontend/src/components/ui/popover.tsx @@ -3,6 +3,8 @@ import * as PopoverPrimitive from "@radix-ui/react-popover"; import { cn } from "@/lib/utils"; +const PopoverArrow = PopoverPrimitive.Arrow; + const Popover = PopoverPrimitive.Root; const PopoverTrigger = PopoverPrimitive.Trigger; @@ -26,4 +28,4 @@ const PopoverContent = React.forwardRef< )); PopoverContent.displayName = PopoverPrimitive.Content.displayName; -export { Popover, PopoverTrigger, PopoverContent }; +export { PopoverArrow, Popover, PopoverTrigger, PopoverContent };