10-04-2026
This commit is contained in:
parent
4d6b4930b2
commit
4bb89aad8c
836 changed files with 52961 additions and 5950 deletions
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
namespace FluxCms\StarterComponents\Components;
|
||||
|
||||
use Livewire\Component;
|
||||
use FluxCms\Core\FieldTypes\BooleanField;
|
||||
use FluxCms\Core\FieldTypes\MediaField;
|
||||
use FluxCms\Core\FieldTypes\TextField;
|
||||
use FluxCms\Core\FieldTypes\WysiwygField;
|
||||
use FluxCms\Core\FieldTypes\MediaField;
|
||||
use FluxCms\Core\FieldTypes\BooleanField;
|
||||
use Livewire\Component;
|
||||
|
||||
class HeroSection extends Component
|
||||
{
|
||||
|
|
@ -109,8 +109,8 @@ class HeroSection extends Component
|
|||
$ctaLink = $content['cta_link'] ?? '';
|
||||
|
||||
foreach ($ctaText as $locale => $text) {
|
||||
if (!empty($text) && empty($ctaLink)) {
|
||||
$errors["cta_link"] = ['Button link is required when button text is provided'];
|
||||
if (! empty($text) && empty($ctaLink)) {
|
||||
$errors['cta_link'] = ['Button link is required when button text is provided'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -127,24 +127,28 @@ class HeroSection extends Component
|
|||
protected function getHeadline(?string $locale = null): string
|
||||
{
|
||||
$locale = $locale ?? app()->getLocale();
|
||||
|
||||
return $this->content['headline'][$locale] ?? '';
|
||||
}
|
||||
|
||||
protected function getSubheadline(?string $locale = null): string
|
||||
{
|
||||
$locale = $locale ?? app()->getLocale();
|
||||
|
||||
return $this->content['subheadline'][$locale] ?? '';
|
||||
}
|
||||
|
||||
protected function getDescription(?string $locale = null): string
|
||||
{
|
||||
$locale = $locale ?? app()->getLocale();
|
||||
|
||||
return $this->content['description'][$locale] ?? '';
|
||||
}
|
||||
|
||||
protected function getCtaText(?string $locale = null): string
|
||||
{
|
||||
$locale = $locale ?? app()->getLocale();
|
||||
|
||||
return $this->content['cta_text'][$locale] ?? '';
|
||||
}
|
||||
|
||||
|
|
@ -165,17 +169,17 @@ class HeroSection extends Component
|
|||
|
||||
protected function hasCta(): bool
|
||||
{
|
||||
return !empty($this->getCtaText()) && !empty($this->getCtaLink());
|
||||
return ! empty($this->getCtaText()) && ! empty($this->getCtaLink());
|
||||
}
|
||||
|
||||
protected function hasBackgroundImage(): bool
|
||||
{
|
||||
return !empty($this->content['background_image']);
|
||||
return ! empty($this->content['background_image']);
|
||||
}
|
||||
|
||||
protected function getBackgroundImageUrl(): ?string
|
||||
{
|
||||
if (!$this->hasBackgroundImage()) {
|
||||
if (! $this->hasBackgroundImage()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -222,4 +226,4 @@ class HeroSection extends Component
|
|||
|
||||
return implode(' ', $classes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue