refactor(dashboard): refine setup checklist UI
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

- Removed progress bar from hero for cleaner look
- Made setup checklist collapsible (auto-collapsed when complete)
- Improved checklist item styling with active/inactive states
This commit is contained in:
Codex Agent
2026-01-18 10:08:39 +01:00
parent 48d4716ab1
commit 1e821a2fb4
2 changed files with 103 additions and 83 deletions

View File

@@ -7,7 +7,6 @@ import { YStack, XStack } from '@tamagui/stacks';
import { SizableText as Text } from '@tamagui/text';
import { Pressable } from '@tamagui/react-native-web-lite';
import { Image } from '@tamagui/image';
import { Progress } from '@tamagui/progress';
import { isSameDay, isPast, isFuture, parseISO, differenceInDays, startOfDay } from 'date-fns';
import { MobileShell } from './components/MobileShell';
@@ -158,10 +157,6 @@ export default function MobileDashboardPage() {
},
});
// Calculate Readiness for Setup Checklist
const readiness = useEventReadiness(activeEvent, t as any);
const phase = activeEvent ? getEventPhase(activeEvent) : 'setup';
const locale = i18n.language?.startsWith('en') ? 'en-GB' : 'de-DE';
React.useEffect(() => {
@@ -189,6 +184,10 @@ export default function MobileDashboardPage() {
);
}
// Calculate Readiness
const readiness = useEventReadiness(activeEvent, t as any);
const phase = activeEvent ? getEventPhase(activeEvent) : 'setup';
return (
<MobileShell activeTab="home" title={t('mobileDashboard.title', 'Dashboard')}>
@@ -203,8 +202,8 @@ export default function MobileDashboardPage() {
readiness={readiness}
/>
{/* 1b. SETUP CHECKLIST (Only in Setup Phase) */}
{phase === 'setup' && !readiness.isReady && (
{/* 1b. SETUP CHECKLIST */}
{phase === 'setup' && (
<SetupChecklist
steps={readiness.steps}
title={t('management:photobooth.checklist.title', 'Checklist')}
@@ -334,9 +333,10 @@ function LifecycleHero({ event, stats, locale, navigate, onSwitch, canSwitch, re
);
}
// SETUP PHASE
// We removed the big button. We show high-level status.
const progressPercent = (readiness.progress ?? 0) * 100;
// SETUP
const nextStep = readiness.nextStep;
const ctaLabel = nextStep ? nextStep.ctaLabel : t('dashboard:onboarding.hero.cta', 'Setup Complete');
const ctaAction = nextStep ? () => navigate(adminPath(nextStep.targetPath)) : undefined;
return (
<YStack>
@@ -358,17 +358,21 @@ function LifecycleHero({ event, stats, locale, navigate, onSwitch, canSwitch, re
<YStack height={1} backgroundColor={theme.border} />
<YStack space="$1.5">
<XStack alignItems="center" justifyContent="space-between">
<Text fontSize="$sm" color={theme.textStrong} fontWeight="600">
{t('management:photobooth.checklist.title', 'Setup Status')}
</Text>
<Text fontSize="$xs" color={theme.muted}>{readiness.completedSteps}/{readiness.totalSteps}</Text>
{/* Main CTA if not ready */}
{!readiness.isReady && (
<ModernButton
label={ctaLabel}
tone='primary'
icon={<ArrowRight size={16} color="white" />}
onPress={ctaAction}
/>
)}
{readiness.isReady && (
<XStack alignItems="center" space="$2">
<CheckCircle2 size={18} color={theme.successText} />
<Text fontSize="$sm" color={theme.successText} fontWeight="700">Ready for Liftoff</Text>
</XStack>
<Progress value={progressPercent} max={100} size="$2" backgroundColor={theme.surfaceMuted} borderWidth={0}>
<Progress.Indicator backgroundColor={theme.primary} />
</Progress>
</YStack>
)}
</ModernCard>
</YStack>
);
@@ -589,4 +593,4 @@ function EmptyState({ canManage, onCreate }: any) {
{canManage && <ModernButton label={t('management:events.list.actions.create', 'Create Event')} onPress={onCreate} />}
</YStack>
);
}
}