style updates
This commit is contained in:
@@ -1,12 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Builder\Components;
|
||||
|
||||
use Modules\Builder\Contracts\BuilderComponent;
|
||||
|
||||
final class HeroComponent implements BuilderComponent
|
||||
{
|
||||
public function type(): string { return 'hero'; }
|
||||
public function label(): string { return 'Hero'; }
|
||||
public function category(): string { return 'Content'; }
|
||||
public function schema(): array { return ['heading'=>['type'=>'text','required'=>true],'content'=>['type'=>'textarea'],'button_label'=>['type'=>'text'],'button_url'=>['type'=>'text']]; }
|
||||
public function defaults(): array { return ['heading'=>'A compelling headline','content'=>'Add supporting content here.','button_label'=>'Learn more','button_url'=>'#']; }
|
||||
public function render(array $properties, array $context=[]): string { return view('builder::components.hero',['properties'=>$properties])->render(); }
|
||||
public function type(): string
|
||||
{
|
||||
return 'hero';
|
||||
}
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return 'Hero';
|
||||
}
|
||||
|
||||
public function category(): string
|
||||
{
|
||||
return 'Content';
|
||||
}
|
||||
|
||||
public function schema(): array
|
||||
{
|
||||
return ['heading' => ['type' => 'text', 'required' => true], 'content' => ['type' => 'textarea'], 'button_label' => ['type' => 'text'], 'button_url' => ['type' => 'text']];
|
||||
}
|
||||
|
||||
public function defaults(): array
|
||||
{
|
||||
return ['heading' => 'A compelling headline', 'content' => 'Add supporting content here.', 'button_label' => 'Learn more', 'button_url' => '#'];
|
||||
}
|
||||
|
||||
public function render(array $properties, array $context = []): string
|
||||
{
|
||||
return view('builder::components.hero', ['properties' => $properties])->render();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user