mirror of
https://github.com/urosran/cally.git
synced 2025-07-15 01:35:22 +00:00
36 lines
982 B
TypeScript
36 lines
982 B
TypeScript
import React from "react";
|
|
import { View, Text, TouchableOpacity } from "react-native-ui-lib";
|
|
import { GroceryCategory, useGroceryContext } from "@/contexts/GroceryContext";
|
|
import { ScrollView } from "react-native-gesture-handler";
|
|
|
|
const CategoryDropdown = (props: {
|
|
setSelectedCategory: (category: GroceryCategory) => void;
|
|
}) => {
|
|
const groceryCategories = Object.values(GroceryCategory);
|
|
|
|
return (
|
|
<View height={100}>
|
|
<ScrollView>
|
|
{groceryCategories.map((category) => (
|
|
<TouchableOpacity
|
|
onPress={() => {
|
|
props.setSelectedCategory(category);
|
|
}}
|
|
>
|
|
<View
|
|
key={category}
|
|
style={{
|
|
padding: 10,
|
|
}}
|
|
>
|
|
<Text style={{fontFamily: "Manrope_400Regular"}}>{category}</Text>
|
|
</View>
|
|
</TouchableOpacity>
|
|
))}
|
|
</ScrollView>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default CategoryDropdown;
|