Skip to content

Commit

Permalink
Merge pull request #6 from vivjamba/expired-food
Browse files Browse the repository at this point in the history
Sets color of expired items as red
  • Loading branch information
Aryan-Dang authored Nov 13, 2022
2 parents 54c6e7e + 482fea4 commit 886a541
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/Todo/FridgeItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ const FridgeItem = ({ item, setStale }) => {
}
};

console.log(typeof currentDaysLeft, currentDaysLeft);


// console.log(item["expDate"]);
// console.log(new Date(item['expDate']).getDate());

return (
<><li className="flex justify-between items-center mt-4 px-4">
<><li className="flex justify-between items-center mt-4 px-4" style={{"color" : ( parseInt(getDaysLeft()) < 0 ? "red" : "")}}>
<div className="flex">
<div
//puts line through item if not bought
Expand Down

0 comments on commit 886a541

Please sign in to comment.