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> = {
|
const STATUS_COLORS: Record<string, string> = {
|
||||||
pending: "#F59E0B",
|
pending: "#F59E0B",
|
||||||
preparing: "#3B82F6",
|
|
||||||
ready: "#10B981",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const STATUS_ICONS: Record<string, keyof typeof Ionicons.glyphMap> = {
|
const STATUS_ICONS: Record<string, keyof typeof Ionicons.glyphMap> = {
|
||||||
pending: "time-outline",
|
pending: "time-outline",
|
||||||
preparing: "construct-outline",
|
|
||||||
ready: "checkmark-circle-outline",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const STATUS_LABELS: Record<string, string> = {
|
const STATUS_LABELS: Record<string, string> = {
|
||||||
pending: "En attente",
|
pending: "En attente",
|
||||||
preparing: "En préparation",
|
|
||||||
ready: "Prêt",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function OrdersScreen() {
|
export default function OrdersScreen() {
|
||||||
@@ -344,19 +338,11 @@ export default function OrdersScreen() {
|
|||||||
fontWeight: "700",
|
fontWeight: "700",
|
||||||
marginTop: spacing.xs,
|
marginTop: spacing.xs,
|
||||||
},
|
},
|
||||||
progressContainer: { marginBottom: spacing.m },
|
|
||||||
progressLabel: {
|
progressLabel: {
|
||||||
color: colors.textMuted,
|
color: colors.textMuted,
|
||||||
fontSize: fontSize.xs,
|
fontSize: fontSize.xs,
|
||||||
marginBottom: spacing.xs,
|
marginBottom: spacing.xs,
|
||||||
},
|
},
|
||||||
progressBar: {
|
|
||||||
height: 4,
|
|
||||||
backgroundColor: colors.bgCard,
|
|
||||||
borderRadius: 2,
|
|
||||||
overflow: "hidden",
|
|
||||||
},
|
|
||||||
progressFill: { height: "100%", borderRadius: 2 },
|
|
||||||
itemCard: {
|
itemCard: {
|
||||||
backgroundColor: colors.bgCard,
|
backgroundColor: colors.bgCard,
|
||||||
borderRadius: borderRadius.sm,
|
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 totalCount = itemsModal.items.length;
|
||||||
const progress = totalCount > 0 ? readyCount / totalCount : 0;
|
|
||||||
|
|
||||||
if (loading) return <LoadingSpinner message="Chargement..." />;
|
if (loading) return <LoadingSpinner message="Chargement..." />;
|
||||||
|
|
||||||
@@ -608,34 +590,28 @@ export default function OrdersScreen() {
|
|||||||
€
|
€
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
{(itemsModal.commandInfo?.referral_used ?? 0) > 0 && (
|
{(itemsModal.commandInfo?.referral_used ?? 0) >
|
||||||
<Text style={[styles.modalTotal, { color: colors.success }]}>
|
0 && (
|
||||||
Parrainage: -{Number(itemsModal.commandInfo.referral_used).toFixed(2)} €
|
<Text
|
||||||
|
style={[
|
||||||
|
styles.modalTotal,
|
||||||
|
{ color: colors.success },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
Parrainage: -
|
||||||
|
{Number(
|
||||||
|
itemsModal.commandInfo.referral_used,
|
||||||
|
).toFixed(2)}{" "}
|
||||||
|
€
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{totalCount > 0 && (
|
{totalCount > 0 && (
|
||||||
<View style={styles.progressContainer}>
|
|
||||||
<Text style={styles.progressLabel}>
|
<Text style={styles.progressLabel}>
|
||||||
{readyCount}/{totalCount} prêts
|
{totalCount} article{totalCount > 1 ? "s" : ""}
|
||||||
</Text>
|
</Text>
|
||||||
<View style={styles.progressBar}>
|
|
||||||
<View
|
|
||||||
style={[
|
|
||||||
styles.progressFill,
|
|
||||||
{
|
|
||||||
width: `${progress * 100}%`,
|
|
||||||
backgroundColor:
|
|
||||||
progress === 1
|
|
||||||
? STATUS_COLORS.ready
|
|
||||||
: colors.info,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{itemsModal.items.map((item: any, index: number) => {
|
{itemsModal.items.map((item: any, index: number) => {
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ export default function DashboardScreen() {
|
|||||||
const activeDelivery =
|
const activeDelivery =
|
||||||
enriched.find(
|
enriched.find(
|
||||||
(d) =>
|
(d) =>
|
||||||
d.status === "in_progress" || d.status === "en_route",
|
d.status === "en_route",
|
||||||
) || enriched.find((d) => d.status === "assigned");
|
) || enriched.find((d) => d.status === "assigned");
|
||||||
if (activeDelivery && activeDelivery.adresse) {
|
if (activeDelivery && activeDelivery.adresse) {
|
||||||
calcRoute(activeDelivery.adresse);
|
calcRoute(activeDelivery.adresse);
|
||||||
@@ -525,7 +525,6 @@ export default function DashboardScreen() {
|
|||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
const renderDelivery = ({ item }: { item: EnrichedDelivery }) => {
|
const renderDelivery = ({ item }: { item: EnrichedDelivery }) => {
|
||||||
const isActive =
|
const isActive =
|
||||||
item.status === "in_progress" ||
|
|
||||||
item.status === "en_route" ||
|
item.status === "en_route" ||
|
||||||
item.status === "arrived" ||
|
item.status === "arrived" ||
|
||||||
item.status === "assigned";
|
item.status === "assigned";
|
||||||
@@ -550,8 +549,7 @@ export default function DashboardScreen() {
|
|||||||
? "Terminée"
|
? "Terminée"
|
||||||
: item.status === "arrived"
|
: item.status === "arrived"
|
||||||
? "Arrivé"
|
? "Arrivé"
|
||||||
: item.status === "in_progress" ||
|
: item.status === "en_route"
|
||||||
item.status === "en_route"
|
|
||||||
? "En cours"
|
? "En cours"
|
||||||
: "En attente"
|
: "En attente"
|
||||||
}
|
}
|
||||||
@@ -561,8 +559,7 @@ export default function DashboardScreen() {
|
|||||||
? colors.success
|
? colors.success
|
||||||
: item.status === "arrived"
|
: item.status === "arrived"
|
||||||
? colors.accent
|
? colors.accent
|
||||||
: item.status === "in_progress" ||
|
: item.status === "en_route"
|
||||||
item.status === "en_route"
|
|
||||||
? colors.warning
|
? colors.warning
|
||||||
: colors.info
|
: colors.info
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ import type { Colors } from "../theme/colors";
|
|||||||
export const STATUS_LABELS: Record<string, string> = {
|
export const STATUS_LABELS: Record<string, string> = {
|
||||||
pending: "En attente",
|
pending: "En attente",
|
||||||
assigned: "Assignée",
|
assigned: "Assignée",
|
||||||
support: "Support",
|
|
||||||
preparing: "En préparation",
|
|
||||||
ready: "Prêt",
|
|
||||||
en_route: "En route",
|
en_route: "En route",
|
||||||
arrived: "Arrivée",
|
arrived: "Arrivée",
|
||||||
livre: "Livrée",
|
livre: "Livrée",
|
||||||
@@ -20,9 +17,6 @@ export const STATUS_LABELS: Record<string, string> = {
|
|||||||
export const getStatusColors = (colors: Colors): Record<string, string> => ({
|
export const getStatusColors = (colors: Colors): Record<string, string> => ({
|
||||||
pending: colors.warning,
|
pending: colors.warning,
|
||||||
assigned: colors.info,
|
assigned: colors.info,
|
||||||
support: colors.warning,
|
|
||||||
preparing: colors.info,
|
|
||||||
ready: colors.accent,
|
|
||||||
en_route: colors.info,
|
en_route: colors.info,
|
||||||
arrived: colors.accent,
|
arrived: colors.accent,
|
||||||
livre: colors.success,
|
livre: colors.success,
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ function getToastType(
|
|||||||
case "assigned":
|
case "assigned":
|
||||||
return "success";
|
return "success";
|
||||||
case "en_route":
|
case "en_route":
|
||||||
case "support":
|
|
||||||
return "info";
|
return "info";
|
||||||
case "livre":
|
case "livre":
|
||||||
return "success";
|
return "success";
|
||||||
|
|||||||
@@ -39,11 +39,8 @@ const TIMELINE_STEPS = [
|
|||||||
const STATUS_INDEX: Record<string, number> = {
|
const STATUS_INDEX: Record<string, number> = {
|
||||||
pending: 0,
|
pending: 0,
|
||||||
assigned: 1,
|
assigned: 1,
|
||||||
support: 1,
|
|
||||||
preparing: 1,
|
|
||||||
en_route: 2,
|
en_route: 2,
|
||||||
arrived: 3,
|
arrived: 3,
|
||||||
ready: 3,
|
|
||||||
livre: 4,
|
livre: 4,
|
||||||
delivered: 4,
|
delivered: 4,
|
||||||
approved: 5,
|
approved: 5,
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ type Nav = NativeStackNavigationProp<ClientStackParamList>;
|
|||||||
const STATUS_PROGRESS: Record<string, number> = {
|
const STATUS_PROGRESS: Record<string, number> = {
|
||||||
pending: 15,
|
pending: 15,
|
||||||
assigned: 25,
|
assigned: 25,
|
||||||
support: 35,
|
|
||||||
en_route: 60,
|
en_route: 60,
|
||||||
arrived: 85,
|
arrived: 85,
|
||||||
livre: 95,
|
livre: 95,
|
||||||
@@ -393,7 +392,6 @@ export default function OrderTrackingScreen() {
|
|||||||
const canCancel = [
|
const canCancel = [
|
||||||
"pending",
|
"pending",
|
||||||
"assigned",
|
"assigned",
|
||||||
"support",
|
|
||||||
"en_route",
|
"en_route",
|
||||||
].includes(order.status);
|
].includes(order.status);
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ import type { Colors } from "../theme/colors";
|
|||||||
export const STATUS_LABELS: Record<string, string> = {
|
export const STATUS_LABELS: Record<string, string> = {
|
||||||
pending: "En attente",
|
pending: "En attente",
|
||||||
assigned: "Assignée",
|
assigned: "Assignée",
|
||||||
support: "Support",
|
|
||||||
preparing: "En préparation",
|
|
||||||
ready: "Prêt",
|
|
||||||
en_route: "En route",
|
en_route: "En route",
|
||||||
arrived: "Arrivée",
|
arrived: "Arrivée",
|
||||||
livre: "Livrée",
|
livre: "Livrée",
|
||||||
@@ -20,9 +17,6 @@ export const STATUS_LABELS: Record<string, string> = {
|
|||||||
export const getStatusColors = (colors: Colors): Record<string, string> => ({
|
export const getStatusColors = (colors: Colors): Record<string, string> => ({
|
||||||
pending: colors.warning,
|
pending: colors.warning,
|
||||||
assigned: colors.info,
|
assigned: colors.info,
|
||||||
support: colors.warning,
|
|
||||||
preparing: colors.info,
|
|
||||||
ready: colors.accent,
|
|
||||||
en_route: colors.info,
|
en_route: colors.info,
|
||||||
arrived: colors.accent,
|
arrived: colors.accent,
|
||||||
livre: colors.success,
|
livre: colors.success,
|
||||||
|
|||||||
Reference in New Issue
Block a user