chore: delete support preparing status
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -49,7 +49,6 @@ function getToastType(
|
||||
case "assigned":
|
||||
return "success";
|
||||
case "en_route":
|
||||
case "support":
|
||||
return "info";
|
||||
case "livre":
|
||||
return "success";
|
||||
|
||||
@@ -39,11 +39,8 @@ const TIMELINE_STEPS = [
|
||||
const STATUS_INDEX: Record<string, number> = {
|
||||
pending: 0,
|
||||
assigned: 1,
|
||||
support: 1,
|
||||
preparing: 1,
|
||||
en_route: 2,
|
||||
arrived: 3,
|
||||
ready: 3,
|
||||
livre: 4,
|
||||
delivered: 4,
|
||||
approved: 5,
|
||||
|
||||
@@ -47,7 +47,6 @@ type Nav = NativeStackNavigationProp<ClientStackParamList>;
|
||||
const STATUS_PROGRESS: Record<string, number> = {
|
||||
pending: 15,
|
||||
assigned: 25,
|
||||
support: 35,
|
||||
en_route: 60,
|
||||
arrived: 85,
|
||||
livre: 95,
|
||||
@@ -393,7 +392,6 @@ export default function OrderTrackingScreen() {
|
||||
const canCancel = [
|
||||
"pending",
|
||||
"assigned",
|
||||
"support",
|
||||
"en_route",
|
||||
].includes(order.status);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user