Skip to content

Commit

Permalink
Add icon to link
Browse files Browse the repository at this point in the history
  • Loading branch information
francoism90 committed May 3, 2024
1 parent b5c54de commit eb4536b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
12 changes: 10 additions & 2 deletions resources/views/actions/button.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<button {{ $attributes
->cssClass([
'layer' => 'inline-flex shrink-0 cursor-pointer items-center justify-center',
'layer' => 'flex shrink-0 cursor-pointer items-center justify-center',
'label' => 'text-sm',
'primary' => 'py-1.5 px-3 bg-primary-500 rounded border border-primary-500',
])
->mergeAttributes($action->getComponentAttributes())
Expand All @@ -13,7 +14,14 @@
])
}}>
@if ($slot->isEmpty())
{{ $label() }}
<x-wireuse::actions-icon
:$action
class:icon="size-6 text-secondary-400"
/>

<span class="{{ $attributes->classFor('label') }}">
{{ $label() }}
</span>
@else
{{ $slot }}
@endif
Expand Down
7 changes: 6 additions & 1 deletion resources/views/actions/link.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<a {{ $attributes
->cssClass([
'layer' => 'inline-flex shrink-0 cursor-pointer items-center justify-center',
'label' => 'text-sm',
'active' => 'text-primary-400 hover:text-primary-300',
'inactive' => 'text-secondary-400 hover:text-primary-400',
])
Expand All @@ -17,7 +18,11 @@
])
}}>
@if ($slot->isEmpty())
{{ $label() }}
<x-wireuse::actions-icon :$action />

<span class="{{ $attributes->classFor('label') }}">
{{ $label() }}
</span>
@else
{{ $slot }}
@endif
Expand Down

0 comments on commit eb4536b

Please sign in to comment.