From 97ede542c454586216c86d8ca6fb3642bd2efba3 Mon Sep 17 00:00:00 2001 From: Flavien G <44913995+fgaujard@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:40:30 +0100 Subject: [PATCH] some fix --- frontend/src/components/style/Navbar.scss | 2 +- frontend/src/pages/Detail.jsx | 55 +++++++++++++++++----- frontend/src/pages/Recipe.jsx | 30 ++++++------ frontend/src/pages/RecipeDetails.jsx | 17 +++---- frontend/src/pages/style/RecipeDetail.scss | 11 ++++- frontend/src/pages/style/RecipeList.scss | 10 ++-- frontend/src/pages/style/detail.scss | 43 +++++++++++++++++ frontend/src/vars.scss | 6 +-- 8 files changed, 127 insertions(+), 47 deletions(-) create mode 100644 frontend/src/pages/style/detail.scss diff --git a/frontend/src/components/style/Navbar.scss b/frontend/src/components/style/Navbar.scss index 799690e..7041bf2 100644 --- a/frontend/src/components/style/Navbar.scss +++ b/frontend/src/components/style/Navbar.scss @@ -146,7 +146,7 @@ @media screen and (max-width: 890px) { .Navbar { - width: calc(100% - 3em); + width: calc(100% - 2em); .SearchButton { display: block; diff --git a/frontend/src/pages/Detail.jsx b/frontend/src/pages/Detail.jsx index e202a9c..cd5ebfb 100644 --- a/frontend/src/pages/Detail.jsx +++ b/frontend/src/pages/Detail.jsx @@ -1,11 +1,20 @@ +import { Link } from "react-router-dom"; import { useState, useEffect } from "react"; import PropTypes from "prop-types"; import axios from "axios"; +import Button from "@mui/material/Button"; + +import img from "../assets/crepe.jpeg"; + +import "./style/detail.scss"; + function Detail({ name, prep, id }) { const [ingredients, setIngredients] = useState([]); const [instructions, setInstructions] = useState([]); + const test = img; + useEffect(() => { const endpoints = [ `${import.meta.env.VITE_BACKEND_URL}/api/ingredientbyrecipe/${id}`, @@ -28,25 +37,47 @@ function Detail({ name, prep, id }) { }, []); return ( -
{prep} minutes
-{element.name} : {element.quantity} {element.unit} de {element.kcal} kcal
{inst.description}
-{inst.description}
+{title}
+{title}
+{kcal} kcal / portion
{difficulty}
-{kcal} kcal par personne
- {tag1 ?{tag1}
: null} - {tag2 ?{tag2}
: null} - {tag3 ?{tag3}
: null} -En savoir plus
- -{tag1}
: null} + {tag2 ?{tag2}
: null} + {tag3 ?{tag3}
: null} +En savoir plus
+retour
- -