From 47b22e4334a6d97d9994ad4313656be1a9c7751f Mon Sep 17 00:00:00 2001 From: Victor Turgeon <76506447+Medenos@users.noreply.github.com> Date: Sat, 29 Oct 2022 12:41:30 -0700 Subject: [PATCH] beautification des menues de filtres --- .../src/components/Filters.js | 256 +++++++++++------- .../grosses-mitaines-ui/src/pages/Morceaux.js | 3 +- .../src/stylesheets/site.css | 46 +++- 3 files changed, 200 insertions(+), 105 deletions(-) diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/Filters.js b/GrossesMitaines/grosses-mitaines-ui/src/components/Filters.js index e6765a6..cbf9f4c 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/Filters.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/Filters.js @@ -1,120 +1,184 @@ import { Form } from "react-bootstrap"; import { useState } from "react"; -import {Button} from "react-bootstrap"; +import { Button } from "react-bootstrap"; +import { Dropdown } from "react-bootstrap"; const Filters = ({ onChange }) => { const [priceFilter, setPriceFilter] = useState(""); const [stateFilter, setStateFilter] = useState(""); + const [priceFilterName, setPriceFilterName] = useState("Aucun"); + const [stateFilterName, setStateFilterName] = useState("Aucun"); + const handlePriceChange = (value) => { setPriceFilter(value); + + switch (value) { + case "PriceUnder20": + setPriceFilterName("Sous 20$") + break; + case "Price20to49": + setPriceFilterName("De 20$ à 49$"); + break; + case "Price50to99": + setPriceFilterName("De 50$ à 99$"); + break; + case "PriceOver100": + setPriceFilterName("Au-déssus de 100$"); + break; + default: + setPriceFilterName("Aucun"); + break; + } } const handleStateChange = (value) => { setStateFilter(value); + + switch (value) { + case "isAvailable": + setStateFilterName("Disponible"); + break; + case "isUnavailable": + setStateFilterName("Indisponible"); + break; + case "isBackOrder": + setStateFilterName("En commande"); + break; + case "isClearance": + setStateFilterName("Liquidation"); + break; + case "isDiscontinued": + setStateFilterName("Discontinué"); + break; + default: + setStateFilterName("Aucun"); + break; + } } return ( -