Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
francoism90 committed Jul 7, 2024
1 parent 1c8f0cd commit f9eeb41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 3 additions & 8 deletions src/Support/Html/HtmlExtended.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));

Check failure on line 22 in src/Support/Html/HtmlExtended.php

View workflow job for this annotation

GitHub Actions / phpstan

Function svg not found.
}
}
4 changes: 2 additions & 2 deletions src/Support/Html/Mixins/BaseElementMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
};
}

Expand Down

0 comments on commit f9eeb41

Please sign in to comment.