From d438a4105303f6baf93239cfd5922048398eb7df Mon Sep 17 00:00:00 2001 From: TRISTAN ZVUNKA Date: Tue, 6 Feb 2024 16:13:47 +0100 Subject: [PATCH] steps ok --- frontend/src/components/Step1.jsx | 6 +- frontend/src/components/Step2.jsx | 108 +++++++++++---------- frontend/src/components/Step3.jsx | 50 +++++----- frontend/src/components/Step4.jsx | 101 +++++++++++++------ frontend/src/pages/CreateRecipe.jsx | 20 ++-- frontend/src/pages/style/CreateRecipe.scss | 105 +++++++++++++++++++- 6 files changed, 274 insertions(+), 116 deletions(-) diff --git a/frontend/src/components/Step1.jsx b/frontend/src/components/Step1.jsx index 4b98de6..cdc5460 100644 --- a/frontend/src/components/Step1.jsx +++ b/frontend/src/components/Step1.jsx @@ -24,7 +24,11 @@ function Step1({ tag }) { return (
-

Votre recette commence ici...

+

+ {" "} + Veuillez remplir les champs ci-dessous avant de passer à l'étape + suivante...{" "} +

{ - setIngredientName(e.target.value); - const ingredientItem = ingredient.find( - (item) => item.name === e.target.value - ); - if (ingredientItem) { - setKcal(ingredientItem.kcal); - setUnit(ingredientItem.unit); - } - }; */ + const handleReset = () => { setIngredientName(""); setQuantity(""); @@ -70,51 +61,62 @@ export default function Step2({ ingredient }) { }; return ( -
-

Step 2

- option.name)} - /* eslint-disable-next-line react/jsx-props-no-spreading */ - renderInput={(params) => } - /> - setQuantity(e.target.value)} - name="quantity" - /> - setUnit(e.target.value)} - name=" unit" - /> - - +
+

Ajouter tous les ingrédients nécessaires...

+
+ option.name)} + /* eslint-disable-next-line react/jsx-props-no-spreading */ + renderInput={(params) => } + /> +
+ setQuantity(e.target.value)} + name="quantity" + /> + + setUnit(e.target.value)} + name=" unit" + /> + + +
+
{ingredientList.map((item) => ( -
- {item.name} - {item.quantity} - {item.unit} +
+ - {item.name} : + + {item.quantity} + + {item.unit} +
+

+ Décrivez les différentes étapes de réalisation de votre recette... +

+
+ setDescription(e.target.value)} + name="quantity" + /> + +
{instructionList.map((item) => ( -
- {item.name} +
+ Instruction n°{item.id + 1} + {item.name}
diff --git a/frontend/src/pages/CreateRecipe.jsx b/frontend/src/pages/CreateRecipe.jsx index e5708d8..fad617d 100644 --- a/frontend/src/pages/CreateRecipe.jsx +++ b/frontend/src/pages/CreateRecipe.jsx @@ -61,15 +61,17 @@ export default function CreateRecipe() { return (
- - {steps.map((label) => { - return ( - - {label} - - ); - })} - +
+ + {steps.map((label) => { + return ( + + {label} + + ); + })} + +
{activeStep > 3 && ( <> diff --git a/frontend/src/pages/style/CreateRecipe.scss b/frontend/src/pages/style/CreateRecipe.scss index 950b9c6..cff373a 100644 --- a/frontend/src/pages/style/CreateRecipe.scss +++ b/frontend/src/pages/style/CreateRecipe.scss @@ -27,8 +27,111 @@ .content-right { margin-top: 5.25rem; } -} + .step-two { + display: flex; + justify-content: space-between; + flex-direction: column; + width: 100%; + gap: 2rem; + } + .selection-div { + display: flex; + justify-content: space-between; + gap: 1.45rem; + align-items: center; + } + .ingredient-autocomplete { + width: 49%; + } + .ingredient-list { + display: flex; + flex-direction: column; + } + .ingredient-item { + display: flex; + justify-content: space-between; + width: 25%; + margin-left: 10%; + margin-right: 30%; + margin-top: 1rem; + padding: 0.5rem; + } + .ingredient-span { + font-size: 1.25rem; + } + .step-three { + display: flex; + justify-content: space-between; + flex-direction: column; + width: 100%; + gap: 2rem; + } + .instruction-content { + display: flex; + justify-content: space-between; + gap: 1.45rem; + align-items: center; + } + .instruction-field { + width: 100%; + } + .instruction-item { + display: flex; + justify-content: space-between; + width: 80%; + margin-left: 10%; + margin-right: 30%; + margin-top: 1rem; + padding: 0.5rem; + gap: 1rem; + } + .ingredient-span { + font-size: 1.25rem; + } + .instruction-span-desc { + font-size: 1.25rem; + } + .step-four-content { + display: flex; + justify-content: space-between; + flex-direction: column; + width: 100%; + gap: 2rem; + } + .submit-recipe { + margin-top: 2rem; + } + .instructions-title { + margin-top: 0.5rem; + font-size: 1.75rem; + margin-bottom: 0.5rem; + } + .ingredients-title { + margin-top: 0.5rem; + font-size: 1.75rem; + margin-bottom: 0.5rem; + } + .recipe-name { + display: flex; + justify-content: space-between; + flex-direction: column; + font-size: 1rem; + } +} .steps { margin-top: 2rem; } +@media screen and (max-width: 800px) { + .body-content.create-page { + width: 100vw; + } + .stepper { + visibility: hidden; + } + .step-one { + display: flex; + flex-direction: column; + width: 100%; + } +}