Implemented a block editor for changing the layout of the page
This commit is contained in:
43
resources/views/components/blocks/hero.blade.php
Normal file
43
resources/views/components/blocks/hero.blade.php
Normal file
@@ -0,0 +1,43 @@
|
||||
@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');
|
||||
@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
|
||||
|
||||
@if ($pageState !== 'expired' && filled(data_get($c, 'subheadline')))
|
||||
<div class="w-full max-w-none whitespace-pre-line text-[15px] leading-[1.65] text-white sm:text-base sm:leading-relaxed">
|
||||
{{ trim((string) data_get($c, 'subheadline')) }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
Reference in New Issue
Block a user