Skip to content

Commit

Permalink
fix: linter in new files
Browse files Browse the repository at this point in the history
  • Loading branch information
alecorvec committed Nov 20, 2024
1 parent 0d28dfb commit 709e99b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
28 changes: 13 additions & 15 deletions src/Components/FoodElem/Ingredientlist/NewIngredientList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React from 'react';
import PropTypes from 'prop-types';

/**
Expand All @@ -11,19 +11,17 @@ import PropTypes from 'prop-types';
*/
function NewIngredientList({data, orderDetails, setOrderDetails}) {

Check failure on line 12 in src/Components/FoodElem/Ingredientlist/NewIngredientList.js

View workflow job for this annotation

GitHub Actions / Lint / Run linters

'orderDetails' is defined but never used

Check failure on line 12 in src/Components/FoodElem/Ingredientlist/NewIngredientList.js

View workflow job for this annotation

GitHub Actions / Lint / Run linters

'setOrderDetails' is defined but never used

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
Expand All @@ -40,7 +38,7 @@ function NewIngredientList({data, orderDetails, setOrderDetails}) {
event.target.className = style
}

const choice = fullData.map((elem) =>
const choice = data.map((elem) =>
<div key={elem.id} className={`${elem.color} w-full row-span-1 grid grid-flow-col grid-cols-12 colbottom-0 content-center pl-6 pr-6`} >
<div className='col-span-10'>
<h1 className="text-3xl text-black float-left ml-4">
Expand Down
4 changes: 1 addition & 3 deletions src/Pages/FoodDetails/FoodModif/FoodModif.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down

0 comments on commit 709e99b

Please sign in to comment.