diff --git a/app/(auth)/grocery/index.tsx b/app/(auth)/grocery/index.tsx
index 8505b86..82f41b3 100644
--- a/app/(auth)/grocery/index.tsx
+++ b/app/(auth)/grocery/index.tsx
@@ -2,15 +2,18 @@ import { ScrollView } from "react-native";
import { Button, Text, View } from "react-native-ui-lib";
import Octicons from "@expo/vector-icons/Octicons";
import GroceryList from "@/components/pages/grocery/GroceryList";
+import AddGroceryItem from "@/components/pages/grocery/AddGroceryItem";
+import { useAuthContext } from "@/contexts/AuthContext";
export default function Screen() {
return (
-
+
+
Welcome to your grocery list!
-
+
X approved items
@@ -20,8 +23,8 @@ export default function Screen() {
}
/>
@@ -29,6 +32,6 @@ export default function Screen() {
-
+
);
}
diff --git a/components/pages/grocery/AddGroceryItem.tsx b/components/pages/grocery/AddGroceryItem.tsx
new file mode 100644
index 0000000..30a334b
--- /dev/null
+++ b/components/pages/grocery/AddGroceryItem.tsx
@@ -0,0 +1,90 @@
+import { StyleSheet } from "react-native";
+import React, { useState } from "react";
+import {
+ Button,
+ Colors,
+ Dialog,
+ Drawer,
+ Text,
+ View,
+ PanningProvider,
+} from "react-native-ui-lib";
+interface AddGroceryItemProps {
+ visible: boolean;
+ onClose: () => void;
+}
+const AddGroceryItem = () => {
+ const [visible, setVisible] = useState(false);
+
+ const handleShowDialog = () => {
+ setVisible(true);
+ };
+ const handleHideDialog = () => {
+ setVisible(false);
+ };
+ const addGroceryDialog = (
+
+ );
+
+ return (
+
+
+ );
+};
+
+export default AddGroceryItem;
+
+const styles = StyleSheet.create({
+ container: {
+ paddingVertical: 10,
+ display: "flex",
+ flexDirection: "column",
+ justifyContent: "space-between",
+ },
+ inner: {
+ paddingHorizontal: 20,
+ display: "flex",
+ flexDirection: "column",
+ },
+ title: {
+ fontSize: 20,
+ fontWeight: "400",
+ textAlign: "center",
+ },
+ divider: {
+ width: "100%",
+ height: 1,
+ backgroundColor: "#E0E0E0",
+ marginVertical: 10,
+ },
+});
diff --git a/components/pages/grocery/GroceryList.tsx b/components/pages/grocery/GroceryList.tsx
index 7d690aa..9f4a9c5 100644
--- a/components/pages/grocery/GroceryList.tsx
+++ b/components/pages/grocery/GroceryList.tsx
@@ -4,6 +4,7 @@ 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";
+import AddGroceryItem from "./AddGroceryItem";
export interface IGrocery {
title: String;
@@ -26,8 +27,8 @@ export enum GroceryCategory {
Frozen = "Frozen",
}
-type MaterialIconNames = keyof typeof MaterialCommunityIcons.glyphMap;
-const iconMapping: { [key in GroceryCategory]: MaterialIconNames } = {
+type MaterialIconNames = keyof typeof MaterialCommunityIcons.glyphMap;
+const iconMapping: { [key in GroceryCategory]: MaterialIconNames } = { //за сад се иконице за категорију бирају одавде
[GroceryCategory.Fruit]: "food-apple",
[GroceryCategory.Dairy]: "cheese",
[GroceryCategory.Vegetables]: "carrot",
@@ -68,7 +69,7 @@ const GroceryList = () => {
bought: false,
},
]);
- const { user, profileType } = useAuthContext();
+ const { profileType } = useAuthContext();
const renderItem = ({ item }: { item: IGrocery }) => (
@@ -136,7 +137,7 @@ const GroceryList = () => {
item.category.toString()}
+ keyExtractor={(item) => item.title.toString()}
/>
);