From 8297a51f80ed800dcef43909f106b9f3f939f925 Mon Sep 17 00:00:00 2001 From: Aditya Bhandari Date: Sat, 30 Apr 2022 14:31:08 -0700 Subject: [PATCH] fixed --- client/src/components/Food.js | 5 ++--- client/src/pages/StockListingAdmin.js | 11 +---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/client/src/components/Food.js b/client/src/components/Food.js index 9ddd164a..d66140f7 100644 --- a/client/src/components/Food.js +++ b/client/src/components/Food.js @@ -4,6 +4,7 @@ import Tags from './Tags.js' import pen from './../images/pen.svg' import checkmark from './../images/instockMark.svg' import xmark from '../images/notinstock.svg' +import { useState } from 'react'; function Food(props) { @@ -62,9 +63,7 @@ function Food(props) { {/* style={{paddingRight: "11%"}} style={{paddingLeft: "6%"}} */}
In Stock - { - props.in_stock = !props.in_stock - }}> +
diff --git a/client/src/pages/StockListingAdmin.js b/client/src/pages/StockListingAdmin.js index aae0dccf..93dbbe65 100644 --- a/client/src/pages/StockListingAdmin.js +++ b/client/src/pages/StockListingAdmin.js @@ -322,10 +322,6 @@ export function StockListingAdmin() { in_stock={foodItem.instock} tags={foodItem.tags} admin={true} - onChange={() => { - foodItem.instock = !foodItem.instock - }} - />))} @@ -509,12 +505,7 @@ export function StockListingUser() { name={foodItem.name} image={foodItem.image} in_stock={foodItem.instock} - tags={foodItem.tags} - onChange={() => { - foodItem.instock = !foodItem.instock - }} - - + tags={foodItem.tags} />))}