diff --git a/components/MyMenuView.tsx b/components/MyMenuView.tsx index e00c310..3d8b999 100644 --- a/components/MyMenuView.tsx +++ b/components/MyMenuView.tsx @@ -1,6 +1,7 @@ import { Link } from "expo-router"; import { StyleSheet, FlatList } from "react-native"; +import { getItemData } from "@/utils"; import { Text, View } from "@/components/Themed"; import { ItemSeparator } from "@/components/ItemSeparator"; import { MyMenuViewItem } from "@/components/MyMenuViewItem"; @@ -23,7 +24,7 @@ export function MyMenuView({ menuData }: { menuData: MenuItem[] }) { } renderItem={({ item }) => ( - + )} style={styles.list} /> diff --git a/components/MyMenuViewItem.tsx b/components/MyMenuViewItem.tsx index b3c4614..3a75595 100644 --- a/components/MyMenuViewItem.tsx +++ b/components/MyMenuViewItem.tsx @@ -1,19 +1,16 @@ import { StyleSheet } from "react-native"; -import { getItemData } from "@/utils"; import { Text, View, Icon } from "@/components/Themed"; -import type { MenuData, MenuItem } from "@/types"; +import type { MenuItemMeta, MenuItem } from "@/types"; export function MyMenuViewItem({ - item: { icon, id, title }, - menuData, + item: { icon, title }, + meta: { isFirst, isLast }, }: { item: MenuItem; - menuData: MenuData; + meta: MenuItemMeta; }) { - let { isFirst, isLast } = getItemData(id, menuData); - return (