From 5329fa1b27494fb46d8dfa5e21dfdd8de2db4b77 Mon Sep 17 00:00:00 2001 From: Xor290 Date: Sun, 8 Mar 2026 19:55:27 +0100 Subject: [PATCH] chore: update --- .../src/screens/admin/OrderDetailScreen.tsx | 5 ++ .../src/screens/admin/SettingsScreen.tsx | 64 +++++++++++-------- .../src/screens/admin/UsersScreen.tsx | 58 +++++++++++++++++ 3 files changed, 102 insertions(+), 25 deletions(-) diff --git a/frontend-admin/src/screens/admin/OrderDetailScreen.tsx b/frontend-admin/src/screens/admin/OrderDetailScreen.tsx index 4595bee2..28481bb0 100644 --- a/frontend-admin/src/screens/admin/OrderDetailScreen.tsx +++ b/frontend-admin/src/screens/admin/OrderDetailScreen.tsx @@ -585,6 +585,11 @@ export default function OrderDetailScreen() { Total: {command.total_prix?.toFixed(2)} € + {command.referral_used > 0 && ( + + Parrainage utilisé: -{command.referral_used?.toFixed(2)} € + + )} {command.livreur_assign && ( Livreur: {command.livreur_assign} diff --git a/frontend-admin/src/screens/admin/SettingsScreen.tsx b/frontend-admin/src/screens/admin/SettingsScreen.tsx index 7af7f051..11fd3ca5 100644 --- a/frontend-admin/src/screens/admin/SettingsScreen.tsx +++ b/frontend-admin/src/screens/admin/SettingsScreen.tsx @@ -29,6 +29,7 @@ function TiersSection({ colors, s, accentColor, + active, }: { title: string; tiers: PointsTier[]; @@ -36,6 +37,7 @@ function TiersSection({ colors: any; s: any; accentColor: string; + active: boolean; }) { const updateTier = (i: number, field: keyof PointsTier, raw: string) => { const val = field === "points" ? parseInt(raw, 10) : parseFloat(raw); @@ -54,7 +56,22 @@ function TiersSection({ return ( - {title} + + {title} + + + {active ? "Actif" : "Ignoré"} + + + Définissez chaque palier : de X€ à Y€ = N points.{"\n"} Max = 0 signifie illimité (pas de borne supérieure). @@ -319,10 +336,8 @@ export default function SettingsScreen() { const ZIP_COLOR = "#9333ea"; const TOTAL_COLOR = "#f97316"; - // Chips disponibles selon le mode - const availableChips: PoolAssignment[] = settings.points_separated - ? ["weed", "zipette", "none"] // mode séparé : T désactivé - : ["total", "none"]; // mode non-séparé : W/Z désactivés + // Tous les chips toujours disponibles — la config reste modifiable à tout moment + const allChips: PoolAssignment[] = ["weed", "zipette", "total", "none"]; return ( @@ -430,29 +445,25 @@ export default function SettingsScreen() { Attribution des catégories aux points {settings.points_separated - ? "Mode séparé : W = pool Weed, Z = pool Zipette." - : "Mode non-séparé : T = pool Total (barème sur W+Z). W et Z désactivés."} + ? "Mode séparé actif : W et Z utilisés pour le calcul. T ignoré." + : "Mode non-séparé actif : T utilisé pour le calcul. W et Z ignorés."} + {"\n"}Vous pouvez modifier les attributions à tout moment. {/* Légende */} - {settings.points_separated ? ( - <> - - - Weed - - - - Zipette - - - ) : ( - - - Total - - )} + + + Weed + + + + Zipette + + + + Total + Aucun @@ -474,7 +485,7 @@ export default function SettingsScreen() { /> {cat.name} - {availableChips.map((p) => { + {allChips.map((p) => { const active = pool === p; const chipColor = p === "weed" @@ -541,6 +552,7 @@ export default function SettingsScreen() { colors={colors} s={s} accentColor={WEED_COLOR} + active={settings.points_separated} /> ("all"); + const [search, setSearch] = useState(""); // Edit client modal const [editClientModal, setEditClientModal] = useState<{ @@ -224,6 +226,22 @@ export default function UsersScreen() { merged = merged.filter((u) => u.role === filter); } + if (search.trim()) { + const q = search.trim().toLowerCase(); + merged = merged.filter((u) => { + if (u.username.toLowerCase().includes(q)) return true; + if (u.clientData) { + const c = u.clientData; + return ( + c.nom.toLowerCase().includes(q) || + c.prenom.toLowerCase().includes(q) || + c.telephone.toLowerCase().includes(q) + ); + } + return false; + }); + } + return merged; }; @@ -542,6 +560,26 @@ export default function UsersScreen() { marginTop: spacing.xxl, }, + // Search bar + searchContainer: { + flexDirection: "row", + alignItems: "center", + marginHorizontal: spacing.m, + marginBottom: spacing.s, + paddingHorizontal: spacing.m, + borderRadius: borderRadius.md, + backgroundColor: colors.bgSecondary, + borderWidth: 1, + borderColor: colors.border, + height: 44, + gap: spacing.s, + }, + searchInput: { + flex: 1, + color: colors.textWhite, + fontSize: fontSize.sm, + }, + // Add button addButton: { flexDirection: "row", @@ -847,6 +885,26 @@ export default function UsersScreen() { })} + {/* Search bar */} + + + + {search.length > 0 && ( + setSearch("")}> + + + )} + + {/* Add user button */}