chore: add select

This commit is contained in:
2026-03-06 18:24:00 +01:00
parent e14a1eb4b8
commit 6a88af9ad2
2 changed files with 19 additions and 19 deletions
@@ -282,7 +282,7 @@ export default function OrdersScreen() {
fontSize: fontSize.sm, fontSize: fontSize.sm,
}, },
dropdownTextDanger: { dropdownTextDanger: {
color: colors.error, color: colors.danger,
fontSize: fontSize.sm, fontSize: fontSize.sm,
}, },
empty: { empty: {
@@ -361,43 +361,43 @@ export default function OrdersScreen() {
condition?: boolean; condition?: boolean;
}; };
const actions: Action[] = [ const actions: Action[] = ([
{ {
label: "Voir items", label: "Voir items",
icon: "receipt-outline", icon: "receipt-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => { setOpenMenuId(null); openItems(item.id); }, onPress: () => { setOpenMenuId(null); openItems(item.id); },
}, },
{ {
label: "Le client est là", label: "Le client est là",
icon: "notifications-outline", icon: "notifications-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => { setOpenMenuId(null); handleNotifyClient(item.id); }, onPress: () => { setOpenMenuId(null); handleNotifyClient(item.id); },
condition: !isDone, condition: !isDone,
}, },
{ {
label: "Assigner livreur", label: "Assigner livreur",
icon: "bicycle-outline", icon: "bicycle-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => { setOpenMenuId(null); openAssignModal(item.id); }, onPress: () => { setOpenMenuId(null); openAssignModal(item.id); },
condition: !isDone, condition: !isDone,
}, },
{ {
label: "Passer en route", label: "Passer en route",
icon: "car-outline", icon: "car-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => { setOpenMenuId(null); handleStatusUpdate(item.id, "en_route"); }, onPress: () => { setOpenMenuId(null); handleStatusUpdate(item.id, "en_route"); },
condition: item.status === "assigned", condition: item.status === "assigned",
}, },
{ {
label: "Confirmer réception", label: "Confirmer réception",
icon: "checkmark-circle-outline", icon: "checkmark-circle-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => { setOpenMenuId(null); handleConfirmReception(item.id); }, onPress: () => { setOpenMenuId(null); handleConfirmReception(item.id); },
condition: item.status === "livre", condition: item.status === "livre",
}, },
{ {
label: "Supprimer", label: "Supprimer",
icon: "trash-outline", icon: "trash-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => { setOpenMenuId(null); handleDelete(item.id); }, onPress: () => { setOpenMenuId(null); handleDelete(item.id); },
danger: true, danger: true,
}, },
].filter((a) => a.condition !== false); ] as Action[]).filter((a) => a.condition !== false);
return ( return (
<Card style={{ marginBottom: spacing.m }}> <Card style={{ marginBottom: spacing.m }}>
@@ -448,7 +448,7 @@ export default function OrdersScreen() {
<Ionicons <Ionicons
name={action.icon} name={action.icon}
size={16} size={16}
color={action.danger ? colors.error : colors.accent} color={action.danger ? colors.danger : colors.accent}
/> />
<Text style={action.danger ? styles.dropdownTextDanger : styles.dropdownText}> <Text style={action.danger ? styles.dropdownTextDanger : styles.dropdownText}>
{action.label} {action.label}
@@ -262,7 +262,7 @@ export default function OrdersScreen() {
fontSize: fontSize.sm, fontSize: fontSize.sm,
}, },
dropdownTextDanger: { dropdownTextDanger: {
color: colors.error, color: colors.danger,
fontSize: fontSize.sm, fontSize: fontSize.sm,
}, },
// Modal summary // Modal summary
@@ -372,35 +372,35 @@ export default function OrdersScreen() {
condition?: boolean; condition?: boolean;
}; };
const actions: Action[] = [ const actions: Action[] = ([
{ {
label: "Voir items", label: "Voir items",
icon: "receipt-outline", icon: "receipt-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => openItems(item.id), onPress: () => openItems(item.id),
}, },
{ {
label: "Le client est là", label: "Le client est là",
icon: "notifications-outline", icon: "notifications-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => handleNotifyClient(item.id), onPress: () => handleNotifyClient(item.id),
}, },
{ {
label: "Assigner livreur", label: "Assigner livreur",
icon: "bicycle-outline", icon: "bicycle-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => openAssignModal(item.id), onPress: () => openAssignModal(item.id),
}, },
{ {
label: "Confirmer réception", label: "Confirmer réception",
icon: "checkmark-circle-outline", icon: "checkmark-circle-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => handleConfirmReception(item.id), onPress: () => handleConfirmReception(item.id),
condition: item.status === "livre", condition: item.status === "livre",
}, },
{ {
label: "Supprimer", label: "Supprimer",
icon: "trash-outline", icon: "trash-outline" as keyof typeof Ionicons.glyphMap,
onPress: () => handleDelete(item.id), onPress: () => handleDelete(item.id),
danger: true, danger: true,
}, },
].filter((a) => a.condition !== false); ] as Action[]).filter((a) => a.condition !== false);
return ( return (
<Card style={{ marginBottom: spacing.m }}> <Card style={{ marginBottom: spacing.m }}>
@@ -440,7 +440,7 @@ export default function OrdersScreen() {
<Ionicons <Ionicons
name={action.icon} name={action.icon}
size={16} size={16}
color={action.danger ? colors.error : colors.accent} color={action.danger ? colors.danger : colors.accent}
/> />
<Text <Text
style={ style={