fix: tickets freeze (useFocusEffect), comment body render, client status from subscription, activation ticket on install, keyboard avoid payment modal
This commit is contained in:
@@ -10,8 +10,16 @@ const STATUS_CONFIG: Record<string, { label: string; color: string; bg: string;
|
||||
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' },
|
||||
NO_SUB: { label: 'No Sub', color: '#6B7280', bg: '#F1F5F9', accent: '#CBD5E1' },
|
||||
};
|
||||
|
||||
// Client.status is null in API — derive from subscription status instead
|
||||
function getClientStatus(client: any) {
|
||||
const sub = client?.subscriptions?.[0];
|
||||
if (!sub) return 'NO_SUB';
|
||||
return sub.status ?? 'PENDING';
|
||||
}
|
||||
|
||||
export default function ClientsScreen() {
|
||||
const [search, setSearch] = useState('');
|
||||
const { data, isLoading, refetch, isRefetching } = useQuery({
|
||||
@@ -63,7 +71,8 @@ export default function ClientsScreen() {
|
||||
refreshControl={<RefreshControl refreshing={isRefetching} onRefresh={refetch} tintColor="#0891B2" />}
|
||||
contentContainerStyle={{ padding: 16, paddingBottom: 32 }}
|
||||
renderItem={({ item }) => {
|
||||
const st = STATUS_CONFIG[item.status] ?? { label: item.status, color: '#475569', bg: '#F1F5F9', accent: '#94A3B8' };
|
||||
const statusKey = getClientStatus(item);
|
||||
const st = STATUS_CONFIG[statusKey] ?? { label: statusKey, color: '#475569', bg: '#F1F5F9', accent: '#94A3B8' };
|
||||
const plan = item.subscriptions?.[0]?.plan?.name;
|
||||
return (
|
||||
<TouchableOpacity
|
||||
|
||||
Reference in New Issue
Block a user