From defacbcc778ba9e6ea37d9cb3b957d5c0c6a4ae5 Mon Sep 17 00:00:00 2001 From: Nemo Date: Tue, 24 Mar 2026 11:33:30 +0800 Subject: [PATCH] fix: client list - prominent status badge with left border accent + plan name --- app/(app)/clients/index.tsx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/(app)/clients/index.tsx b/app/(app)/clients/index.tsx index c81d2f8..641124a 100644 --- a/app/(app)/clients/index.tsx +++ b/app/(app)/clients/index.tsx @@ -5,11 +5,11 @@ import { useQuery } from '@tanstack/react-query'; import { router } from 'expo-router'; import { api } from '../../../services/api'; -const STATUS_CONFIG: Record = { - ACTIVE: { label: 'Active', color: '#166534', bg: '#DCFCE7' }, - SUSPENDED: { label: 'Suspended', color: '#92400E', bg: '#FEF3C7' }, - CANCELLED: { label: 'Cancelled', color: '#991B1B', bg: '#FEE2E2' }, - PENDING: { label: 'Pending', color: '#475569', bg: '#F1F5F9' }, +const STATUS_CONFIG: Record = { + ACTIVE: { label: 'Active', color: '#166534', bg: '#DCFCE7', accent: '#16A34A' }, + SUSPENDED: { label: 'Suspended', color: '#92400E', bg: '#FEF3C7', accent: '#D97706' }, + CANCELLED: { label: 'Cancelled', color: '#991B1B', bg: '#FEE2E2', accent: '#DC2626' }, + PENDING: { label: 'Pending', color: '#475569', bg: '#F1F5F9', accent: '#94A3B8' }, }; export default function ClientsScreen() { @@ -63,21 +63,22 @@ export default function ClientsScreen() { refreshControl={} contentContainerStyle={{ padding: 16, paddingBottom: 32 }} renderItem={({ item }) => { - const st = STATUS_CONFIG[item.status] ?? { label: item.status, color: '#475569', bg: '#F1F5F9' }; + const st = STATUS_CONFIG[item.status] ?? { label: item.status, color: '#475569', bg: '#F1F5F9', accent: '#94A3B8' }; + const plan = item.subscriptions?.[0]?.plan?.name; return ( router.push(`/(app)/clients/${item.id}`)} activeOpacity={0.7} > - + {item.firstName} {item.lastName} - {item.accountNumber} - {item.phone && {item.phone}} + {item.accountNumber}{plan ? ` ยท ${plan}` : ''} + {item.phone && {item.phone}} - - {st.label} + + {st.label}