Skip to content

Commit

Permalink
fix: picker value
Browse files Browse the repository at this point in the history
  • Loading branch information
KatyH820 committed May 17, 2024
1 parent c7eebc6 commit 8055761
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/expo/src/app/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ import { LinearGradient } from "tamagui/linear-gradient";

import type { MenuWithRelations } from "@zotmeal/db";
import type { PeriodName } from "@zotmeal/utils";
import { restaurantIdEnum } from "@zotmeal/db";
import {
getCurrentPeriodName,
getRestaurantNameById,
PeriodEnum,
restaurantIds,
restaurantNames,
} from "@zotmeal/utils";

Expand Down Expand Up @@ -242,11 +244,13 @@ const PeriodPicker = ({
color,
}}
selectedValue={periodName}
onValueChange={(itemValue, _) => setPeriodName(itemValue)}
onValueChange={(itemValue, _) => {
setPeriodName(itemValue);
}}
>
{/* Create a Picker.Item for each period */}
{Object.entries(PeriodEnum).map(([period, id]) => (
<Picker.Item key={id} label={period} value={id} />
<Picker.Item key={id} label={period} value={period} />
))}
</Picker>
);
Expand Down

0 comments on commit 8055761

Please sign in to comment.