diff --git a/src/Components/FoodElem/Ingredientlist/NewIngredientList.js b/src/Components/FoodElem/Ingredientlist/NewIngredientList.js index 5b1d194..cefb62b 100644 --- a/src/Components/FoodElem/Ingredientlist/NewIngredientList.js +++ b/src/Components/FoodElem/Ingredientlist/NewIngredientList.js @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; /** @@ -11,19 +11,17 @@ import PropTypes from 'prop-types'; */ function NewIngredientList({data, orderDetails, setOrderDetails}) { - let current = {value: "", done: false}; - - const [fullData, setFullData] = useState(data.map((elem => { - return { - id: elem.id, - name: elem.name, - color_green: 'bg-kitchen-food-ingredient-green', - color_red: 'bg-kitchen-food-ingredient-red', - add: false, - del: false, - all: false - } - }))); + // const [fullData, setFullData] = useState(data.map((elem => { + // return { + // id: elem.id, + // name: elem.name, + // color_green: 'bg-kitchen-food-ingredient-green', + // color_red: 'bg-kitchen-food-ingredient-red', + // add: false, + // del: false, + // all: false + // } + // }))); const handleClick = (event) => { let style = event.target.className @@ -40,7 +38,7 @@ function NewIngredientList({data, orderDetails, setOrderDetails}) { event.target.className = style } - const choice = fullData.map((elem) => + const choice = data.map((elem) =>

diff --git a/src/Pages/FoodDetails/FoodModif/FoodModif.js b/src/Pages/FoodDetails/FoodModif/FoodModif.js index cfe5d4f..ce64b73 100644 --- a/src/Pages/FoodDetails/FoodModif/FoodModif.js +++ b/src/Pages/FoodDetails/FoodModif/FoodModif.js @@ -1,10 +1,8 @@ -import React, { useState } from 'react'; +import React from 'react'; import { useLocation, useOutletContext } from "react-router-dom"; -import IngredientsButton from "../../../Components/FoodElem/IngredientsButton/IngredientsButton"; import ModifBackButton from "../../../Components/FoodElem/ModifButton/ModifBackButton"; -import IngredientList from "../../../Components/FoodElem/Ingredientlist/IngredientList"; import NewIngredientList from '../../../Components/FoodElem/Ingredientlist/NewIngredientList';