From 1c2f18e288e7ed3cf10fd52c46d42b530ef2a70a Mon Sep 17 00:00:00 2001 From: Dejan Date: Sun, 8 Dec 2024 14:01:35 +0100 Subject: [PATCH] - Grocery list changes - Removed the Add item button from the bottom and added an empty grocery box --- components/pages/grocery/EditGroceryItem.tsx | 28 ++++++++-------- components/pages/grocery/GroceryList.tsx | 34 +++++++++++--------- components/pages/grocery/GroceryWrapper.tsx | 1 - 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/components/pages/grocery/EditGroceryItem.tsx b/components/pages/grocery/EditGroceryItem.tsx index 4f8e559..fd5cf83 100644 --- a/components/pages/grocery/EditGroceryItem.tsx +++ b/components/pages/grocery/EditGroceryItem.tsx @@ -113,24 +113,24 @@ const EditGroceryItem = ({ }} maxLength={25} /> - + {(editGrocery.title || editGrocery.title !== "") && { - if (editGrocery.closeEdit) { - editGrocery.closeEdit(); - } - }} + onPress={() => { + if (editGrocery.closeEdit) { + editGrocery.closeEdit(); + } + }} /> - + } void}) => { setPendingGroceries(groceries?.filter((item) => !item.approved)); }, [groceries]); + const handleCancelAddGrocery = () => { + setIsAddingGrocery(false); + setTitle(""); + setCategory(GroceryCategory.None) + } + return ( void}) => { - {isAddingGrocery && ( - - setIsAddingGrocery(false) - }} - onInputFocus={onInputFocus} - /> - - )} + + + {/* Render Approved Groceries Grouped by Category */} {approvedGroceries?.length > 0 diff --git a/components/pages/grocery/GroceryWrapper.tsx b/components/pages/grocery/GroceryWrapper.tsx index b93db37..e62e667 100644 --- a/components/pages/grocery/GroceryWrapper.tsx +++ b/components/pages/grocery/GroceryWrapper.tsx @@ -71,7 +71,6 @@ const GroceryWrapper = () => { - {!isAddingGrocery && } ); };