From 4b70a50baf36e9bad0b0b5e85a2a36406bf0896d Mon Sep 17 00:00:00 2001 From: David Belisle <79233327+DavidBelisle@users.noreply.github.com> Date: Tue, 18 Oct 2022 12:07:54 -0400 Subject: [PATCH] biiii papa palop --- .../src/components/SimpleItem.js | 25 ++++++++++++++++++- .../src/stylesheets/site.css | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js b/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js index 5dd1ece..807436d 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/SimpleItem.js @@ -1,6 +1,29 @@ import { FaTimes } from 'react-icons/fa' import { FaTools } from 'react-icons/fa' +function renderStatus(statusCode) { + if (statusCode !== undefined) { + + switch (statusCode) { + case 0: + return ("Disponible"); + case 1: + return ("En commande"); + case 2: + return ("Indisponible"); + case 3: + return ("Liquidation"); + case 4: + return ("Promotion"); + case 5: + return ("Discontinué"); + default: + return (<>>); + } + } + +} + const SimpleItem = ({ item, onDelete, onModify }) => { return (
Categoie: {item.category}, Prix: {item.price}, Promo: {item.promoPrice}, Quantité: {item.quantity}
+Categoie: {item.category}, Prix: {item.price}, Promo: {item.promoPrice}, Quantité: {item.quantity}, Disponibilité: {renderStatus(item.status)}
Description: {item.description}
) diff --git a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css index 5067a8c..3b7e18c 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css +++ b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css @@ -436,6 +436,7 @@ html { display: inline-block; height: auto; width: 97.5%; + padding: 1.25%; }