diff --git a/src/Support/Html/HtmlExtended.php b/src/Support/Html/HtmlExtended.php index 4efffd58..7414ef90 100644 --- a/src/Support/Html/HtmlExtended.php +++ b/src/Support/Html/HtmlExtended.php @@ -3,7 +3,7 @@ namespace Foxws\WireUse\Support\Html; use Livewire\Form; -use Spatie\Html\Elements\Element; +use Spatie\Html\Elements\Div; use Spatie\Html\Html; class HtmlExtended extends Html @@ -17,13 +17,8 @@ public function wireForm(Form $value): static return $this; } - public function icon(string $name) + public function icon(string $name, ?string $class = null, ?array $attributes = []): Div { - return $this->div(svg($name, 'fill-white size-5 text-white')); - - // return $this - // ->element('svg') - // ->attribute('name', $name) - // ->toHtml(); + return $this->div(svg($name, $class, $attributes)); } } diff --git a/src/Support/Html/Mixins/BaseElementMixin.php b/src/Support/Html/Mixins/BaseElementMixin.php index 4e0da67c..9e685b07 100644 --- a/src/Support/Html/Mixins/BaseElementMixin.php +++ b/src/Support/Html/Mixins/BaseElementMixin.php @@ -18,7 +18,7 @@ public function wireKey(): mixed public function wireIgnore(): mixed { - return function (?bool $self = null) { + return function (?bool $self = false) { /** @var BaseElement $this */ return $self @@ -41,7 +41,7 @@ public function wireSubmit(): mixed return function (?string $action = null) { /** @var BaseElement $this */ - return $this->attributeIfNotNull($action, 'wire:submit', $action); + return $this->attribute('wire:submit', $action); }; }