chore: delete support preparing status

This commit is contained in:
2026-03-09 21:07:12 +01:00
parent 7c04e61eb2
commit f6b3948839
7 changed files with 19 additions and 64 deletions
@@ -32,20 +32,14 @@ import { useAlert } from "../../hooks/useAlert";
const STATUS_COLORS: Record<string, string> = {
pending: "#F59E0B",
preparing: "#3B82F6",
ready: "#10B981",
};
const STATUS_ICONS: Record<string, keyof typeof Ionicons.glyphMap> = {
pending: "time-outline",
preparing: "construct-outline",
ready: "checkmark-circle-outline",
};
const STATUS_LABELS: Record<string, string> = {
pending: "En attente",
preparing: "En préparation",
ready: "Prêt",
};
export default function OrdersScreen() {
@@ -344,19 +338,11 @@ export default function OrdersScreen() {
fontWeight: "700",
marginTop: spacing.xs,
},
progressContainer: { marginBottom: spacing.m },
progressLabel: {
color: colors.textMuted,
fontSize: fontSize.xs,
marginBottom: spacing.xs,
},
progressBar: {
height: 4,
backgroundColor: colors.bgCard,
borderRadius: 2,
overflow: "hidden",
},
progressFill: { height: "100%", borderRadius: 2 },
itemCard: {
backgroundColor: colors.bgCard,
borderRadius: borderRadius.sm,
@@ -533,11 +519,7 @@ export default function OrdersScreen() {
);
};
const readyCount = itemsModal.items.filter(
(i) => i.status === "ready",
).length;
const totalCount = itemsModal.items.length;
const progress = totalCount > 0 ? readyCount / totalCount : 0;
if (loading) return <LoadingSpinner message="Chargement..." />;
@@ -608,34 +590,28 @@ export default function OrdersScreen() {
</Text>
)}
{(itemsModal.commandInfo?.referral_used ?? 0) > 0 && (
<Text style={[styles.modalTotal, { color: colors.success }]}>
Parrainage: -{Number(itemsModal.commandInfo.referral_used).toFixed(2)}
{(itemsModal.commandInfo?.referral_used ?? 0) >
0 && (
<Text
style={[
styles.modalTotal,
{ color: colors.success },
]}
>
Parrainage: -
{Number(
itemsModal.commandInfo.referral_used,
).toFixed(2)}{" "}
</Text>
)}
</View>
)}
{totalCount > 0 && (
<View style={styles.progressContainer}>
<Text style={styles.progressLabel}>
{readyCount}/{totalCount} prêts
</Text>
<View style={styles.progressBar}>
<View
style={[
styles.progressFill,
{
width: `${progress * 100}%`,
backgroundColor:
progress === 1
? STATUS_COLORS.ready
: colors.info,
},
]}
/>
</View>
</View>
<Text style={styles.progressLabel}>
{totalCount} article{totalCount > 1 ? "s" : ""}
</Text>
)}
{itemsModal.items.map((item: any, index: number) => {
@@ -266,7 +266,7 @@ export default function DashboardScreen() {
const activeDelivery =
enriched.find(
(d) =>
d.status === "in_progress" || d.status === "en_route",
d.status === "en_route",
) || enriched.find((d) => d.status === "assigned");
if (activeDelivery && activeDelivery.adresse) {
calcRoute(activeDelivery.adresse);
@@ -525,7 +525,6 @@ export default function DashboardScreen() {
// --------------------------------------------------
const renderDelivery = ({ item }: { item: EnrichedDelivery }) => {
const isActive =
item.status === "in_progress" ||
item.status === "en_route" ||
item.status === "arrived" ||
item.status === "assigned";
@@ -550,8 +549,7 @@ export default function DashboardScreen() {
? "Terminée"
: item.status === "arrived"
? "Arrivé"
: item.status === "in_progress" ||
item.status === "en_route"
: item.status === "en_route"
? "En cours"
: "En attente"
}
@@ -561,8 +559,7 @@ export default function DashboardScreen() {
? colors.success
: item.status === "arrived"
? colors.accent
: item.status === "in_progress" ||
item.status === "en_route"
: item.status === "en_route"
? colors.warning
: colors.info
}
-6
View File
@@ -3,9 +3,6 @@ import type { Colors } from "../theme/colors";
export const STATUS_LABELS: Record<string, string> = {
pending: "En attente",
assigned: "Assignée",
support: "Support",
preparing: "En préparation",
ready: "Prêt",
en_route: "En route",
arrived: "Arrivée",
livre: "Livrée",
@@ -20,9 +17,6 @@ export const STATUS_LABELS: Record<string, string> = {
export const getStatusColors = (colors: Colors): Record<string, string> => ({
pending: colors.warning,
assigned: colors.info,
support: colors.warning,
preparing: colors.info,
ready: colors.accent,
en_route: colors.info,
arrived: colors.accent,
livre: colors.success,