- Added delete button on the checked grocery items

This commit is contained in:
Dejan
2024-12-08 13:15:06 +01:00
parent ecee34bf26
commit 12f1a51292

View File

@ -134,6 +134,17 @@ const GroceryItem = ({
) : ( ) : (
!isEditingTitle && !isEditingTitle &&
(isParent || isCaregiver) && ( (isParent || isCaregiver) && (
<View row>
{item.bought &&
<AntDesign
name="close"
size={24}
style={{ color: "grey", marginRight: 10 }}
onPress={() => {
handleItemApproved(item.id, { approved: false });
deleteGrocery(item.id);
}}/>
}
<Checkbox <Checkbox
value={item.bought} value={item.bought}
containerStyle={[styles.checkbox, { borderRadius: 50 }]} containerStyle={[styles.checkbox, { borderRadius: 50 }]}
@ -145,6 +156,7 @@ const GroceryItem = ({
updateGroceryItem({ id: item.id, bought: !item.bought }) updateGroceryItem({ id: item.id, bought: !item.bought })
} }
/> />
</View>
) )
)} )}
</View> </View>