changes to groceries, todos

This commit is contained in:
ivic00
2024-09-12 23:04:41 +02:00
parent 53f7118656
commit f291f985a3
13 changed files with 444 additions and 137 deletions

View File

@ -1,26 +1,34 @@
import React from "react";
import { View, Text, TouchableOpacity } from "react-native-ui-lib";
import { GroceryCategory } from "@/contexts/GroceryContext";
import { GroceryCategory, useGroceryContext } from "@/contexts/GroceryContext";
import { ScrollView } from "react-native-gesture-handler";
const CategoryDropdown = () => {
const CategoryDropdown = (props: {
setSelectedCategory: (category: GroceryCategory) => void;
}) => {
const groceryCategories = Object.values(GroceryCategory);
return (
<ScrollView height={100}>
{groceryCategories.map((category) => (
<TouchableOpacity onPress={() => {}}>
<View
key={category}
style={{
padding: 10,
<View height={100}>
<ScrollView>
{groceryCategories.map((category) => (
<TouchableOpacity
onPress={() => {
props.setSelectedCategory(category);
}}
>
<Text>{category}</Text>
</View>
</TouchableOpacity>
))}
</ScrollView>
<View
key={category}
style={{
padding: 10,
}}
>
<Text>{category}</Text>
</View>
</TouchableOpacity>
))}
</ScrollView>
</View>
);
};