mirror of
https://github.com/urosran/cally.git
synced 2025-07-15 17:47:08 +00:00
- Moved the touching area on the whole grocery card not just on the text
This commit is contained in:
@ -68,7 +68,7 @@ const EditGroceryItem = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
setGrocery(defaultGroceryItem);
|
closeEdit();
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
|
@ -39,6 +39,7 @@ const GroceryItem = ({
|
|||||||
return `${firstName.charAt(0).toUpperCase()}${lastName.charAt(0).toUpperCase()}`;
|
return `${firstName.charAt(0).toUpperCase()}${lastName.charAt(0).toUpperCase()}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isEditable = (isParent || isCaregiver) && item.approved && !item.bought;
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
key={item.id}
|
key={item.id}
|
||||||
@ -49,6 +50,7 @@ const GroceryItem = ({
|
|||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<TouchableOpacity onPress={isEditable ? () => setIsEditingTitle(true) : null}>
|
||||||
<View
|
<View
|
||||||
row
|
row
|
||||||
spread
|
spread
|
||||||
@ -65,7 +67,6 @@ const GroceryItem = ({
|
|||||||
item={item}
|
item={item}
|
||||||
onClose={() => setOpenFreqEdit(false)}
|
onClose={() => setOpenFreqEdit(false)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{isEditingTitle ? (
|
{isEditingTitle ? (
|
||||||
<EditGroceryItem
|
<EditGroceryItem
|
||||||
editGrocery={item}
|
editGrocery={item}
|
||||||
@ -75,7 +76,6 @@ const GroceryItem = ({
|
|||||||
) : (
|
) : (
|
||||||
<View flex>
|
<View flex>
|
||||||
{(isParent || isCaregiver) && !item.bought ? (
|
{(isParent || isCaregiver) && !item.bought ? (
|
||||||
<TouchableOpacity onPress={() => setIsEditingTitle(true)}>
|
|
||||||
<Text
|
<Text
|
||||||
text70T
|
text70T
|
||||||
style={[
|
style={[
|
||||||
@ -87,7 +87,6 @@ const GroceryItem = ({
|
|||||||
>
|
>
|
||||||
{item.title}
|
{item.title}
|
||||||
</Text>
|
</Text>
|
||||||
</TouchableOpacity>
|
|
||||||
) : (
|
) : (
|
||||||
<Text
|
<Text
|
||||||
text70T
|
text70T
|
||||||
@ -152,6 +151,7 @@ const GroceryItem = ({
|
|||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
{!item.approved && (
|
{!item.approved && (
|
||||||
<>
|
<>
|
||||||
|
Reference in New Issue
Block a user