mirror of
https://github.com/urosran/cally.git
synced 2025-11-27 00:44:54 +00:00
todo filtering, nanny shopping
This commit is contained in:
@ -25,6 +25,7 @@ const GroceryItem = ({
|
||||
const { profileData } = useAuthContext();
|
||||
const { data: creator } = useGetUserById(item.creatorId);
|
||||
const isParent = profileData?.userType === ProfileType.PARENT;
|
||||
const isCaregiver = profileData?.userType === ProfileType.CAREGIVER;
|
||||
|
||||
const [openFreqEdit, setOpenFreqEdit] = useState<boolean>(false);
|
||||
const [isEditingTitle, setIsEditingTitle] = useState<boolean>(false);
|
||||
@ -36,7 +37,7 @@ const GroceryItem = ({
|
||||
const closeEdit = () => setIsEditingTitle(false);
|
||||
|
||||
const getInitials = (firstName: string, lastName: string) => {
|
||||
return `${firstName.charAt(0)}${lastName.charAt(0)}`;
|
||||
return `${firstName.charAt(0).toUpperCase()}${lastName.charAt(0).toUpperCase()}`;
|
||||
};
|
||||
|
||||
return (
|
||||
@ -81,7 +82,7 @@ const GroceryItem = ({
|
||||
/>
|
||||
) : (
|
||||
<View flex>
|
||||
{isParent ? (
|
||||
{(isParent || isCaregiver) && !item.bought ? (
|
||||
<TouchableOpacity onPress={() => setIsEditingTitle(true)}>
|
||||
<Text
|
||||
text70T
|
||||
@ -98,7 +99,7 @@ const GroceryItem = ({
|
||||
) : (
|
||||
<Text
|
||||
text70T
|
||||
style={[styles.title, { color: item.bought ? "red" : "black" }]}
|
||||
style={[styles.title, { textDecorationLine: item.bought ? "line-through" : "none", }]}
|
||||
>
|
||||
{item.title}
|
||||
</Text>
|
||||
@ -108,7 +109,7 @@ const GroceryItem = ({
|
||||
|
||||
{!item.approved ? (
|
||||
<View row centerV>
|
||||
{isParent && (
|
||||
{isParent || isCaregiver && (
|
||||
<>
|
||||
<AntDesign
|
||||
name="check"
|
||||
@ -132,7 +133,7 @@ const GroceryItem = ({
|
||||
</View>
|
||||
) : (
|
||||
!isEditingTitle &&
|
||||
isParent && (
|
||||
(isParent || isCaregiver) && (
|
||||
<Checkbox
|
||||
value={item.bought}
|
||||
containerStyle={[styles.checkbox, { borderRadius: 50 }]}
|
||||
@ -180,7 +181,7 @@ const GroceryItem = ({
|
||||
width: 24.64,
|
||||
aspectRatio: 1,
|
||||
marginRight: 8,
|
||||
backgroundColor: "#ccc",
|
||||
backgroundColor: creator?.eventColor || "gray",
|
||||
borderRadius: 100,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
|
||||
Reference in New Issue
Block a user