From 9d8f01d29482f3b48790eb1c53422a7387d23527 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Tue, 20 Jan 2026 13:21:39 +0100 Subject: [PATCH] Refresh event overview list UI --- resources/js/admin/mobile/EventsPage.tsx | 201 +++++++++--------- .../mobile/__tests__/EventsPage.test.tsx | 23 ++ 2 files changed, 120 insertions(+), 104 deletions(-) diff --git a/resources/js/admin/mobile/EventsPage.tsx b/resources/js/admin/mobile/EventsPage.tsx index e395bbb..0df958a 100644 --- a/resources/js/admin/mobile/EventsPage.tsx +++ b/resources/js/admin/mobile/EventsPage.tsx @@ -1,13 +1,14 @@ import React from 'react'; import { useNavigate } from 'react-router-dom'; -import { CalendarDays, MapPin, Plus, Search, Camera, Users, Sparkles } from 'lucide-react'; +import { CalendarDays, MapPin, Plus, Search, Camera, Users, Sparkles, ChevronRight } from 'lucide-react'; import { Card } from '@tamagui/card'; import { YStack, XStack } from '@tamagui/stacks'; import { SizableText as Text } from '@tamagui/text'; import { Pressable } from '@tamagui/react-native-web-lite'; import { ScrollView } from '@tamagui/scroll-view'; import { ToggleGroup } from '@tamagui/toggle-group'; -import { Separator } from '@tamagui/separator'; +import { ListItem } from '@tamagui/list-item'; +import { YGroup } from '@tamagui/group'; import { useTranslation } from 'react-i18next'; import { MobileShell, HeaderActionButton } from './components/MobileShell'; import { PillBadge, CTAButton, FloatingActionButton, SkeletonCard } from './components/Primitives'; @@ -351,142 +352,134 @@ function EventsList({ ) : ( - filteredEvents.map((event) => { - const statusKey = resolveEventStatusKey(event); - const statusLabel = - statusKey === 'draft' - ? t('events.list.filters.draft') - : statusKey === 'past' - ? t('events.list.filters.past') - : t('events.list.filters.upcoming'); - const statusTone = statusKey === 'draft' ? 'warning' : statusKey === 'past' ? 'muted' : 'success'; - return ( - - ); - }) + + + {filteredEvents.map((event) => { + const statusKey = resolveEventStatusKey(event); + const statusLabel = + statusKey === 'draft' + ? t('events.list.filters.draft') + : statusKey === 'past' + ? t('events.list.filters.past') + : t('events.list.filters.upcoming'); + const statusTone = statusKey === 'draft' ? 'warning' : statusKey === 'past' ? 'muted' : 'success'; + return ( + + onOpen(event.slug)} + title={ + + } + iconAfter={ + + + {t('events.list.actions.open')} + + + + } + /> + + ); + })} + + )} ); } -function EventRow({ +function EventListItem({ event, text, muted, subtle, - border, primary, - surface, - shadow, statusLabel, statusTone, - onOpen, onEdit, }: { event: TenantEvent; text: string; muted: string; subtle: string; - border: string; primary: string; - surface: string; - shadow: string; statusLabel: string; statusTone: 'success' | 'warning' | 'muted'; - onOpen: (slug: string) => void; onEdit?: (slug: string) => void; }) { const { t, i18n } = useTranslation('management'); const locale = i18n.language; const stats = buildEventListStats(event); return ( - - - - - - {renderName(event.name, t)} - - - - - {formatDate(event.event_date, t, locale)} - - - - - - {resolveLocation(event, t)} - - - {statusLabel} - + + + + {renderName(event.name, t)} + + + {statusLabel} {onEdit ? ( onEdit(event.slug)}> - - ˅ + + {t('events.list.actions.settings', 'Settings')} ) : null} - - - - - + + + + + + {formatDate(event.event_date, t, locale)} + - - - - onOpen(event.slug)}> - - - - {t('events.list.actions.open')} - - - - - + + + + {resolveLocation(event, t)} + + + + + + + + + ); } diff --git a/resources/js/admin/mobile/__tests__/EventsPage.test.tsx b/resources/js/admin/mobile/__tests__/EventsPage.test.tsx index b87f627..08697e1 100644 --- a/resources/js/admin/mobile/__tests__/EventsPage.test.tsx +++ b/resources/js/admin/mobile/__tests__/EventsPage.test.tsx @@ -167,6 +167,29 @@ vi.mock('@tamagui/separator', () => ({ Separator: () =>
, })); +vi.mock('@tamagui/list-item', () => ({ + ListItem: ({ + title, + iconAfter, + onPress, + }: { + title?: React.ReactNode; + iconAfter?: React.ReactNode; + onPress?: () => void; + }) => ( +
+ {title} + {iconAfter} +
+ ), +})); + +vi.mock('@tamagui/group', () => ({ + YGroup: Object.assign(({ children }: { children: React.ReactNode }) =>
{children}
, { + Item: ({ children }: { children: React.ReactNode }) =>
{children}
, + }), +})); + vi.mock('@tamagui/stacks', () => ({ YStack: ({ children }: { children: React.ReactNode }) =>
{children}
, XStack: ({ children }: { children: React.ReactNode }) =>
{children}
,