Add missing admin addon translations and fix event name rendering
This commit is contained in:
@@ -148,6 +148,21 @@ function resolveScopeFromQuery(input: string | null): 'photos' | 'guests' | 'gal
|
||||
return null;
|
||||
}
|
||||
|
||||
function resolveEventName(
|
||||
name: TenantEvent['name'],
|
||||
t: (key: string, fallback: string) => string,
|
||||
): string {
|
||||
if (typeof name === 'string' && name.trim() !== '') {
|
||||
return name;
|
||||
}
|
||||
|
||||
if (name && typeof name === 'object') {
|
||||
return name.de ?? name.en ?? Object.values(name)[0] ?? t('events.placeholders.untitled', 'Untitled event');
|
||||
}
|
||||
|
||||
return t('events.placeholders.untitled', 'Untitled event');
|
||||
}
|
||||
|
||||
export default function MobileEventAddonsPage() {
|
||||
const { slug } = useParams<{ slug: string }>();
|
||||
const navigate = useNavigate();
|
||||
@@ -355,7 +370,7 @@ export default function MobileEventAddonsPage() {
|
||||
{t('events.addons.event', 'Event')}
|
||||
</Text>
|
||||
<Text fontSize="$lg" fontWeight="800" color={textStrong}>
|
||||
{typeof event.name === 'string' ? event.name : t('events.placeholders.untitled', 'Untitled event')}
|
||||
{resolveEventName(event.name, t as any)}
|
||||
</Text>
|
||||
{event.package?.name ? (
|
||||
<XStack gap="$2" alignItems="center" flexWrap="wrap">
|
||||
@@ -403,7 +418,7 @@ export default function MobileEventAddonsPage() {
|
||||
{!hasSellableAddons ? (
|
||||
<MobileCard>
|
||||
<Text fontSize="$sm" color={muted}>
|
||||
{t('events.recap.noAddonAvailable', 'No add-ons are currently available.')}
|
||||
{t('events.addons.noAddonAvailable', 'No add-ons are currently available.')}
|
||||
</Text>
|
||||
</MobileCard>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user