From 2e089f7f77d0566aa1c8588ae34ee652039771ec Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Thu, 22 Jan 2026 17:17:10 +0100 Subject: [PATCH] Unify setup status block --- .../js/admin/i18n/locales/de/dashboard.json | 1 + .../js/admin/i18n/locales/en/dashboard.json | 1 + resources/js/admin/mobile/DashboardPage.tsx | 77 +++++++++++-------- .../mobile/components/SetupChecklist.tsx | 42 ++++++---- 4 files changed, 75 insertions(+), 46 deletions(-) diff --git a/resources/js/admin/i18n/locales/de/dashboard.json b/resources/js/admin/i18n/locales/de/dashboard.json index c971bd0..191c834 100644 --- a/resources/js/admin/i18n/locales/de/dashboard.json +++ b/resources/js/admin/i18n/locales/de/dashboard.json @@ -50,6 +50,7 @@ "readiness": { "title": "Bereit für den Eventstart", "description": "Erledige diese Schritte, damit Gäste ohne Reibung loslegen können.", + "nextStepTitle": "Nächster Schritt", "pending": "Noch offen", "complete": "Erledigt", "items": { diff --git a/resources/js/admin/i18n/locales/en/dashboard.json b/resources/js/admin/i18n/locales/en/dashboard.json index 8ec9593..92d0c93 100644 --- a/resources/js/admin/i18n/locales/en/dashboard.json +++ b/resources/js/admin/i18n/locales/en/dashboard.json @@ -50,6 +50,7 @@ "readiness": { "title": "Ready for event day", "description": "Complete these steps so guests can join without friction.", + "nextStepTitle": "Next step", "pending": "Pending", "complete": "Done", "items": { diff --git a/resources/js/admin/mobile/DashboardPage.tsx b/resources/js/admin/mobile/DashboardPage.tsx index 9378b01..963d188 100644 --- a/resources/js/admin/mobile/DashboardPage.tsx +++ b/resources/js/admin/mobile/DashboardPage.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useNavigate, useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { useQuery } from '@tanstack/react-query'; -import { AlertCircle, Bell, CalendarDays, Camera, CheckCircle2, ChevronRight, Download, Image as ImageIcon, Layout, ListTodo, Megaphone, QrCode, Settings, ShieldCheck, Sparkles, TrendingUp, Tv, Users } from 'lucide-react'; +import { AlertCircle, Bell, CalendarDays, Camera, CheckCircle2, ChevronRight, Circle, Download, Image as ImageIcon, Layout, ListTodo, Megaphone, QrCode, Settings, ShieldCheck, Sparkles, TrendingUp, Tv, Users } from 'lucide-react'; import { Button } from '@tamagui/button'; import { Card } from '@tamagui/card'; import { YGroup } from '@tamagui/group'; @@ -218,15 +218,6 @@ export default function MobileDashboardPage() { variant="embedded" /> - {/* 1b. SETUP CHECKLIST */} - {phase === 'setup' && ( - - )} - {/* 2. PULSE STRIP */} @@ -398,9 +389,7 @@ function LifecycleHero({ event, stats, locale, navigate, readiness, variant = 'd // 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; - const showCta = Boolean(nextStep); + const showNextStep = Boolean(nextStep); return ( @@ -424,24 +413,52 @@ function LifecycleHero({ event, stats, locale, navigate, readiness, variant = 'd - {showCta ? : null} - - {showCta ? ( - + {showNextStep ? ( + + + {t('dashboard:readiness.nextStepTitle', 'Next step')} + + + + navigate(adminPath(nextStep.targetPath))} + title={ + + + + {nextStep.label} + + + } + subTitle={ + nextStep.description ? ( + + {nextStep.description} + + ) : undefined + } + iconAfter={ + + {nextStep.ctaLabel} + + + } + /> + + + ) : null} + + + diff --git a/resources/js/admin/mobile/components/SetupChecklist.tsx b/resources/js/admin/mobile/components/SetupChecklist.tsx index 565193f..f0da4d0 100644 --- a/resources/js/admin/mobile/components/SetupChecklist.tsx +++ b/resources/js/admin/mobile/components/SetupChecklist.tsx @@ -22,32 +22,21 @@ export function SetupChecklist({ }: { steps: ReadinessStep[]; title: string; - variant?: 'card' | 'embedded'; + variant?: 'card' | 'inline'; }) { const theme = useAdminTheme(); const { t } = useTranslation('dashboard'); const navigate = useNavigate(); const isAllComplete = steps.every(s => s.isComplete); - const [collapsed, setCollapsed] = React.useState(isAllComplete); - const isEmbedded = variant === 'embedded'; + const [collapsed, setCollapsed] = React.useState(true); + const isInline = variant === 'inline'; const completedCount = steps.filter(s => s.isComplete).length; const totalSteps = steps.length; const progressValue = totalSteps > 0 ? Math.round((completedCount / totalSteps) * 100) : 0; - return ( - + const content = ( + setCollapsed(!collapsed)}> @@ -132,6 +121,27 @@ export function SetupChecklist({ )} + + ); + + if (isInline) { + return content; + } + + return ( + + {content} ); }