Render hero subheadline and expired message on one line so Blade indentation is not preserved by whitespace-pre-line. Made-with: Cursor
45 lines
1.7 KiB
PHP
45 lines
1.7 KiB
PHP
@props([
|
|
'block',
|
|
'page',
|
|
'pageState' => 'active',
|
|
])
|
|
|
|
@php
|
|
/** @var \App\Models\PageBlock $block */
|
|
/** @var \App\Models\PreregistrationPage $page */
|
|
$c = $block->content ?? [];
|
|
$align = (string) data_get($c, 'text_alignment', 'center');
|
|
$alignClass = match ($align) {
|
|
'left' => 'items-start text-left',
|
|
'right' => 'items-end text-right',
|
|
default => 'items-center text-center',
|
|
};
|
|
$eyebrow = data_get($c, 'eyebrow_text');
|
|
$eyebrowStyle = (string) data_get($c, 'eyebrow_style', 'badge');
|
|
$subheadlineRaw = data_get($c, 'subheadline');
|
|
$subheadline = is_string($subheadlineRaw) ? trim($subheadlineRaw) : '';
|
|
@endphp
|
|
|
|
<div class="flex w-full flex-col {{ $alignClass }} space-y-4">
|
|
@if (filled($eyebrow) && $eyebrowStyle !== 'none')
|
|
@if ($eyebrowStyle === 'badge')
|
|
<span class="inline-flex rounded-full border border-white/25 bg-white/10 px-3 py-1 text-xs font-semibold uppercase tracking-wider text-white/90">
|
|
{{ $eyebrow }}
|
|
</span>
|
|
@else
|
|
<p class="text-sm font-medium text-white/80">{{ $eyebrow }}</p>
|
|
@endif
|
|
@endif
|
|
|
|
@if (filled(data_get($c, 'headline')))
|
|
<h1 class="w-full max-w-none text-balance text-2xl font-bold leading-snug tracking-tight text-festival sm:text-3xl">
|
|
{{ data_get($c, 'headline') }}
|
|
</h1>
|
|
@endif
|
|
|
|
{{-- Subheadline must sit on one line inside the div: whitespace-pre-line turns Blade indentation into visible leading space. --}}
|
|
@if ($pageState !== 'expired' && $subheadline !== '')
|
|
<div class="w-full max-w-none whitespace-pre-line text-[15px] leading-[1.65] text-white sm:text-base sm:leading-relaxed">{{ $subheadline }}</div>
|
|
@endif
|
|
</div>
|