fix(dashboard): resolve missing translations and refine alert styling
- 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
This commit is contained in:
@@ -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() {
|
||||
<PulseStrip event={activeEvent} stats={stats} />
|
||||
|
||||
{/* 3. ALERTS */}
|
||||
<AlertsSection event={activeEvent} stats={stats} />
|
||||
<AlertsSection event={activeEvent} stats={stats} t={t} />
|
||||
|
||||
{/* 4. UNIFIED COMMAND GRID */}
|
||||
<UnifiedToolGrid
|
||||
@@ -520,28 +526,39 @@ function RecentPhotosSection({ photos, navigate, slug }: { photos: TenantPhoto[]
|
||||
);
|
||||
}
|
||||
|
||||
function AlertsSection({ event, stats }: any) {
|
||||
function AlertsSection({ event, stats, t }: any) {
|
||||
const theme = useAdminTheme();
|
||||
const limitWarnings = buildLimitWarnings(event?.limits ?? null, (k: string) => k);
|
||||
const limitWarnings = buildLimitWarnings(event?.limits ?? null, translateLimits(t));
|
||||
|
||||
if (!limitWarnings.length) return null;
|
||||
|
||||
return (
|
||||
<YStack space="$2">
|
||||
{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 (
|
||||
<XStack
|
||||
key={idx}
|
||||
backgroundColor={theme.warningBg}
|
||||
backgroundColor={bg}
|
||||
padding="$3"
|
||||
borderRadius={12}
|
||||
borderWidth={1}
|
||||
borderColor={theme.warningBorder}
|
||||
borderColor={border}
|
||||
alignItems="center"
|
||||
space="$2"
|
||||
>
|
||||
<Text fontSize="$sm" color={theme.warningText}>
|
||||
<Icon size={16} color={text} />
|
||||
<Text fontSize="$sm" color={text} fontWeight="600">
|
||||
{w.message}
|
||||
</Text>
|
||||
</XStack>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</YStack>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user