diff --git a/GrossesMitaines/grosses-mitaines-ui/public/images/chandailquetaine.jpg b/GrossesMitaines/grosses-mitaines-ui/public/images/chandailquetaine.jpg new file mode 100644 index 0000000..e79ce13 Binary files /dev/null and b/GrossesMitaines/grosses-mitaines-ui/public/images/chandailquetaine.jpg differ diff --git a/GrossesMitaines/grosses-mitaines-ui/public/images/doudou.jpg b/GrossesMitaines/grosses-mitaines-ui/public/images/doudou.jpg new file mode 100644 index 0000000..0b46a5f Binary files /dev/null and b/GrossesMitaines/grosses-mitaines-ui/public/images/doudou.jpg differ diff --git a/GrossesMitaines/grosses-mitaines-ui/public/images/kokin.jpg b/GrossesMitaines/grosses-mitaines-ui/public/images/kokin.jpg new file mode 100644 index 0000000..35bd3b5 Binary files /dev/null and b/GrossesMitaines/grosses-mitaines-ui/public/images/kokin.jpg differ diff --git a/GrossesMitaines/grosses-mitaines-ui/public/images/mitaines.jpg b/GrossesMitaines/grosses-mitaines-ui/public/images/mitaines.jpg new file mode 100644 index 0000000..55e47fd Binary files /dev/null and b/GrossesMitaines/grosses-mitaines-ui/public/images/mitaines.jpg differ diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/Item.js b/GrossesMitaines/grosses-mitaines-ui/src/components/Item.js index c63ee83..234998e 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/Item.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/Item.js @@ -1,17 +1,105 @@ -const Item = ({ imageUrl, name, price, status }) => { +import { Card } from "react-bootstrap"; + +// public enum States { +// Available, +// BackOrder, +// Unavailable, +// Clearance, +// Promotion, +// Discontinued +// } +function renderStatus(statusCode) { + 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 ( + <> + ); + } +} + +function renderPrice(price, newPrice) { + + if (newPrice < 0) { + return ( + + + {price.toFixed(2).toString().replace(".", ",")} $ CA + + + ); + } + else { + return ( + + + {price.toFixed(2).toString().replace(".", ",")} $ CA + + + {newPrice.toFixed(2).toString().replace(".", ",")} $ CA + + + ); + } + +} + +const Item = ({ imageUrl, name, price, newPrice, status }) => { return ( -
-
- {name} -
-
-

{name}

-
-
-
- {price} -
-
+ + + + +
+ + {name} + +
+
+ {renderStatus(status)} +
+
+ {renderPrice(price, newPrice)} +
+ +
+
); } diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/ItemList.js b/GrossesMitaines/grosses-mitaines-ui/src/components/ItemList.js index 9a285f6..4424818 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/ItemList.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/ItemList.js @@ -3,12 +3,13 @@ import Item from './Item'; const ItemList = ({ items }) => { return ( -
+
{items.map((item) => )}
diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/Morceaux.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/Morceaux.js index e5548f1..bae1402 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/Morceaux.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/Morceaux.js @@ -3,24 +3,65 @@ import ItemList from "../components/ItemList"; const Morceaux = () => { + + // public enum States { + // Available, + // BackOrder, + // Unavailable, + // Clearance, + // Promotion, + // Discontinued + // } + const products = [ { "name": "Ceinture flèchée", - "status": "Disponible!", - "price": "85,86", + "status": 0, + "price": 85.86, + "newPrice": -1, "imageUrl": "/images/ceintureflechee.jpg" }, + { + "name": "Chandail de nowel", + "status": 2, + "price": 69.50, + "newPrice": -1, + "imageUrl": "/images/chandailquetaine.jpg" + }, { "name": "Pantoufles du Canadien en Phentex", - "status": "Non disponible...", - "price": "15,64", + "status": 5, + "price": 15.64, + "newPrice": -1, "imageUrl": "/images/pantouflesCH.jpg" }, { "name": "Jean-Luc Mongrain", - "status": "Disponible!", - "price": "1453,12", + "status": 1, + "price": 1453.12, + "newPrice": -1, "imageUrl": "/images/jeanlucmongrain.jpg" + }, + { + "name": "Mitaines de laine", + "status": 4, + "price": 24.99, + "newPrice": 19.99, + "imageUrl": "/images/mitaines.jpg" + }, + { + "name": "Sous-vêtements coquins", + "status": 3, + "price": 19.99, + "newPrice": 14.99, + "imageUrl": "/images/kokin.jpg" + }, + { + "name": "Doudou douce et grise", + "status": 3, + "price": 99.99, + "newPrice": 89.99, + "imageUrl": "/images/doudou.jpg" } ]; @@ -30,7 +71,6 @@ const Morceaux = () => { return (
-

QWERTY

); diff --git a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css index 9926170..e14ee52 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css +++ b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css @@ -200,20 +200,159 @@ html { } + +/* items */ +.item-list { + text-align: center; +} + +.item:hover{ + box-shadow: 10px 10px; + top:-5px; + left:-5px; + background-color: beige; +} + .item { - border: 5px purple double; - border-radius: 5px; - padding: 1rem 0; - margin: 1rem 0; + + border:purple double 3px; + margin-left: 1.25%; + margin-right: 1.25%; + margin-bottom: 10px; + background-color: rgba(245, 245, 220, 0.75); + display: inline-block; + height:300px; + width: 30%; } -.item-detail { - padding: 0 2rem; +.item-img { + padding-top: 2%; + box-shadow: 5px 5px; + border-radius: 2px; + display:block; + margin-right: auto; + margin-left: auto; + height:50%; + width:auto; } -.item-price { +.item-info{ + height:50%; + padding-top: 10px; + padding-bottom: 10px; +} + +.item-name-container{ + height:45%; + display: flex; + justify-content: center; + align-items: center; + vertical-align: middle; +} + +.item-name { + margin:auto; + height: auto; +} + +.item-status-container{ + height:40px; + display: flex; + justify-content: center; + align-items: center; + vertical-align: middle; +} + +.item-status { + font-weight: normal; + font-family: 'Courier New', Courier, monospace; + width: fit-content; + height:fit-content; + margin-left: auto; + margin-right: auto; + padding-left: 5px; + padding-right: 5px; + padding-top: 5px; + padding-bottom: 2px; + display: block; + border-radius: 10px; + font-size: small; +} + +.item-status-available{ + color:green; +} + +.item-status-backorder{ + color:yellow; + background-color: black; +} + +.item-status-unavailable{ + color:red; + background-color: black; +} + +.item-status-clearence{ + color:blue; + background-color: aliceblue; + font-size: large; + border: yellow 2px groove; +} + +.item-status-promotion{ + color:purple; + font-size: medium; + background-color: aliceblue; + border: yellow 2px groove; +} + +.item-status-discontinued{ + color:white; + background-color: black; +} + +.item-price-container{ + height: fit-content; + width: auto; + margin: auto; +} + +.item-price{ + color:green; font-weight: bold; - font-size: 140%; + font-size: large; + height:auto; + margin:auto; +} + +.item-old-price{ + position:relative; + color:black; + text-decoration: line-through; + font-weight: normal; + font-size: small; + height:auto; + width: fit-content; +} + +.item-new-price{ + font-size: large; + margin-left: 10px; + font-weight: bolder; + background-color: aliceblue; + color: purple; + +} + + +/* -------------------------------------------------------- */ +/* specification pour les moyennes écrans +/* -------------------------------------------------------- */ +@media(max-width:900px){ + .item{ + width:45%; + } } @@ -222,6 +361,11 @@ html { /* -------------------------------------------------------- */ @media (max-width:450px) { + + .item{ + width:85%; + } + .featured-img { border: 5px purple double; width: 100%; @@ -255,8 +399,8 @@ html { } - .contact-info-container{ - padding-top:5%; + .contact-info-container { + padding-top: 5%; } .employee-text {