mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 08:24:55 +00:00
grocery icon changes
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
import { FlatList } from "react-native";
|
||||
import React, { useState } from "react";
|
||||
import { View, Text, ListItem } from "react-native-ui-lib";
|
||||
import { View, Text, ListItem, Button } from "react-native-ui-lib";
|
||||
import MaterialCommunityIcons from "@expo/vector-icons/MaterialCommunityIcons";
|
||||
import { ProfileType, useAuthContext } from "@/contexts/AuthContext";
|
||||
import AntDesign from "@expo/vector-icons/AntDesign";
|
||||
|
||||
export interface IGrocery {
|
||||
title: String;
|
||||
@ -66,7 +68,7 @@ const GroceryList = () => {
|
||||
bought: false,
|
||||
},
|
||||
]);
|
||||
|
||||
const { user, profileType } = useAuthContext();
|
||||
const renderItem = ({ item }: { item: IGrocery }) => (
|
||||
<ListItem backgroundColor="white">
|
||||
<ListItem.Part left containerStyle={{ flex: 1, paddingStart: 15 }}>
|
||||
@ -90,9 +92,42 @@ const GroceryList = () => {
|
||||
</View>
|
||||
</ListItem.Part>
|
||||
<ListItem.Part right containerStyle={{ paddingEnd: 15 }}>
|
||||
<Text style={{ color: item.approved ? "green" : "red" }}>
|
||||
{item.approved ? "+" : "X"}
|
||||
</Text>
|
||||
{profileType == ProfileType.PARENT ? (
|
||||
<View row>
|
||||
<Button
|
||||
children={
|
||||
<AntDesign
|
||||
name="check"
|
||||
size={24}
|
||||
style={{
|
||||
color: item.approved ? "green" : "#aaaaaa",
|
||||
}}
|
||||
/>
|
||||
}
|
||||
backgroundColor="transparent"
|
||||
size={Button.sizes.small}
|
||||
/>
|
||||
<Button
|
||||
children={
|
||||
<AntDesign
|
||||
name="close"
|
||||
size={24}
|
||||
style={{ color: item.approved ? "#aaaaaa" : "red" }}
|
||||
/>
|
||||
}
|
||||
backgroundColor="transparent"
|
||||
size={Button.sizes.small}
|
||||
/>
|
||||
</View>
|
||||
) : (
|
||||
<Text style={{ color: item.bought ? "green" : "red" }}>
|
||||
{item.approved ? <AntDesign
|
||||
name="check"
|
||||
size={24}
|
||||
color={'green'}
|
||||
/> : "X"}
|
||||
</Text>
|
||||
)}
|
||||
</ListItem.Part>
|
||||
</ListItem>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user