mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 08:24:55 +00:00
- Grocery list changes
- Removed the Add item button from the bottom and added an empty grocery box
This commit is contained in:
@ -113,7 +113,7 @@ const EditGroceryItem = ({
|
|||||||
}}
|
}}
|
||||||
maxLength={25}
|
maxLength={25}
|
||||||
/>
|
/>
|
||||||
<View row centerV>
|
{(editGrocery.title || editGrocery.title !== "") && <View row centerV>
|
||||||
<AntDesign
|
<AntDesign
|
||||||
name="check"
|
name="check"
|
||||||
size={24}
|
size={24}
|
||||||
@ -130,7 +130,7 @@ const EditGroceryItem = ({
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>}
|
||||||
</View>
|
</View>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
style={{ marginTop: 15 }}
|
style={{ marginTop: 15 }}
|
||||||
|
|||||||
@ -98,6 +98,12 @@ const GroceryList = ({onInputFocus}: {onInputFocus: (y: number) => void}) => {
|
|||||||
setPendingGroceries(groceries?.filter((item) => !item.approved));
|
setPendingGroceries(groceries?.filter((item) => !item.approved));
|
||||||
}, [groceries]);
|
}, [groceries]);
|
||||||
|
|
||||||
|
const handleCancelAddGrocery = () => {
|
||||||
|
setIsAddingGrocery(false);
|
||||||
|
setTitle("");
|
||||||
|
setCategory(GroceryCategory.None)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View marginH-20 marginB-45>
|
<View marginH-20 marginB-45>
|
||||||
<HeaderTemplate
|
<HeaderTemplate
|
||||||
@ -244,7 +250,6 @@ const GroceryList = ({onInputFocus}: {onInputFocus: (y: number) => void}) => {
|
|||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{isAddingGrocery && (
|
|
||||||
<View style={{marginTop: 8}}>
|
<View style={{marginTop: 8}}>
|
||||||
<EditGroceryItem
|
<EditGroceryItem
|
||||||
editGrocery={{
|
editGrocery={{
|
||||||
@ -253,12 +258,11 @@ const GroceryList = ({onInputFocus}: {onInputFocus: (y: number) => void}) => {
|
|||||||
category: category,
|
category: category,
|
||||||
setTitle: setTitle,
|
setTitle: setTitle,
|
||||||
setSubmit: setSubmitted,
|
setSubmit: setSubmitted,
|
||||||
closeEdit: () => setIsAddingGrocery(false)
|
closeEdit: handleCancelAddGrocery
|
||||||
}}
|
}}
|
||||||
onInputFocus={onInputFocus}
|
onInputFocus={onInputFocus}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Render Approved Groceries Grouped by Category */}
|
{/* Render Approved Groceries Grouped by Category */}
|
||||||
{approvedGroceries?.length > 0
|
{approvedGroceries?.length > 0
|
||||||
|
|||||||
@ -71,7 +71,6 @@ const GroceryWrapper = () => {
|
|||||||
<GroceryList onInputFocus={handleInputFocus} />
|
<GroceryList onInputFocus={handleInputFocus} />
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
{!isAddingGrocery && <AddGroceryItem />}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user