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