-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Toggle button added instead of text on click
- Loading branch information
1 parent
efb92ea
commit e71882d
Showing
14 changed files
with
128 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
@props(['type' => 'submit']) | ||
<button type="{{$type}}" | ||
wire:loading.attr="disabled" wire:loading.class="cursor-wait" | ||
{{$attributes->merge(['class' => 'bg-indigo-300 hover:bg-indigo-500 rounded py-1 px-2 focus:outline-none'])}}> | ||
{{$slot}} | ||
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@props(['text', 'state' => 'positive']) | ||
@php | ||
$statusClasses = match ($state) { | ||
'positive' => 'bg-green-100 text-green-700', | ||
'negative' => 'bg-red-100 text-red-700', | ||
'neutral' => 'bg-red-100 text-gray-600', | ||
} | ||
@endphp | ||
|
||
<span {{$attributes->merge(['class' => "inline-flex items-center rounded-full px-2 py-1 text-xs font-medium whitespace-nowrap ".$statusClasses])}}>{{$text}}</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@props(['text' => null, 'isEnabled' => false]) | ||
<div class="flex items-center"> | ||
<!-- Enabled: "bg-indigo-600", Not Enabled: "bg-gray-200" --> | ||
<button {{$attributes}} | ||
type="button" | ||
wire:loading.attr="disabled" wire:loading.class="cursor-wait" | ||
@class([ | ||
'relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-offset-2', | ||
'bg-indigo-600' => $isEnabled, | ||
'bg-gray-200' => !$isEnabled, | ||
]) | ||
role="switch" aria-checked="false" aria-labelledby="annual-billing-label"> | ||
|
||
<!-- Enabled: "translate-x-5", Not Enabled: "translate-x-0" --> | ||
<span aria-hidden="true" | ||
@class([ | ||
"pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out", | ||
'translate-x-5' => $isEnabled, | ||
'translate-x-0' => !$isEnabled, | ||
])></span> | ||
</button> | ||
@if($text) | ||
<div class="inline ml-3">{{$text}}</div> | ||
@endif | ||
</div> |
43 changes: 22 additions & 21 deletions
43
resources/views/livewire/backend/article/index-row.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 22 additions & 23 deletions
45
resources/views/livewire/backend/category/index-row.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters