From 0c5939e541801fe6ea4834a4efc083dbba1b6fe7 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Sat, 17 Jan 2026 18:06:14 +0100 Subject: [PATCH] fix(dashboard): resolve missing translations and refine alert styling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated useEventReadiness hook to use 'Bearbeiten' instead of untranslated string - Fixed 'guestsBlocked' literal appearing in alerts by passing translator correctly - Refined limit warning styles to respect danger tone - Localized pulse strip labels (Fotos, Gäste) properly --- resources/js/admin/mobile/DashboardPage.tsx | 33 ++++++++++++++----- .../admin/mobile/hooks/useEventReadiness.ts | 14 ++++---- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/resources/js/admin/mobile/DashboardPage.tsx b/resources/js/admin/mobile/DashboardPage.tsx index 2f2d86d..a5e8367 100644 --- a/resources/js/admin/mobile/DashboardPage.tsx +++ b/resources/js/admin/mobile/DashboardPage.tsx @@ -20,6 +20,12 @@ import { buildLimitWarnings } from '../lib/limitWarnings'; import { withAlpha } from './components/colors'; import { useEventReadiness } from './hooks/useEventReadiness'; +// --- HELPERS --- + +function translateLimits(t: any) { + return (key: string, options?: any) => t(`management:limits.${key}`, key, options); +} + // --- MODERN PRIMITIVES --- function ModernCard({ children, style, ...rest }: any) { @@ -194,7 +200,7 @@ export default function MobileDashboardPage() { {/* 3. ALERTS */} - + {/* 4. UNIFIED COMMAND GRID */} k); + const limitWarnings = buildLimitWarnings(event?.limits ?? null, translateLimits(t)); if (!limitWarnings.length) return null; return ( - {limitWarnings.map((w: any, idx: number) => ( + {limitWarnings.map((w: any, idx: number) => { + const isDanger = w.tone === 'danger'; + const bg = isDanger ? theme.dangerBg : theme.warningBg; + const border = isDanger ? theme.dangerText : theme.warningBorder; + const text = isDanger ? theme.dangerText : theme.warningText; + const Icon = isDanger ? AlertCircle : Bell; + + return ( - + + {w.message} - ))} + ); + })} ); } diff --git a/resources/js/admin/mobile/hooks/useEventReadiness.ts b/resources/js/admin/mobile/hooks/useEventReadiness.ts index a245d9e..86f340f 100644 --- a/resources/js/admin/mobile/hooks/useEventReadiness.ts +++ b/resources/js/admin/mobile/hooks/useEventReadiness.ts @@ -45,16 +45,16 @@ export function useEventReadiness(event: TenantEvent | null, t: (key: string, fa const steps: ReadinessStep[] = [ { id: 'basics', - label: t('management:events.form.date', 'Date & Location'), + label: t('management:events.form.date', 'Datum & Ort'), isComplete: hasDate && hasLocation, - ctaLabel: t('management:events.actions.edit', 'Set Date & Location'), + ctaLabel: t('management:events.actions.edit', 'Bearbeiten'), targetPath: `/mobile/events/${event.slug}/edit`, priority: 1 }, { id: 'access', - label: t('management:invites.badge', 'QR Codes'), - ctaLabel: t('management:invites.actions.create', 'Get QR Code'), + label: t('management:invites.badge', 'QR-Codes'), + ctaLabel: t('management:invites.actions.create', 'QR-Code erstellen'), isComplete: hasInvite, targetPath: `/mobile/events/${event.slug}/qr`, priority: 3 @@ -64,9 +64,9 @@ export function useEventReadiness(event: TenantEvent | null, t: (key: string, fa if (tasksEnabled) { steps.push({ id: 'tasks', - label: t('management:tasks.badge', 'Photo Tasks'), + label: t('management:tasks.badge', 'Aufgaben'), isComplete: hasTasks, - ctaLabel: t('management:tasks.actions.assign', 'Add Photo Tasks'), + ctaLabel: t('management:tasks.actions.assign', 'Aufgaben hinzufügen'), targetPath: `/mobile/events/${event.slug}/tasks`, priority: 2 }); @@ -87,4 +87,4 @@ export function useEventReadiness(event: TenantEvent | null, t: (key: string, fa nextStep, isReady: !nextStep }; -} +} \ No newline at end of file