-
Notifications
You must be signed in to change notification settings - Fork 13
Added loader for buttons #969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e12aece
Added loader for buttons
Roene-JustBetter ed9f178
[CI] Update Snapshots
Roene-JustBetter 21dac71
Keep 1 disabled attribute
Roene-JustBetter 1824dc8
Added loading animation for other buttons
Roene-JustBetter 8f948b1
Merge branch 'master' into feature/add-loading-for-buttons
Roene-JustBetter 0d91c6f
Fix search button
Roene-JustBetter 0122767
[CI] Update Snapshots
Roene-JustBetter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,14 +1,3 @@ | ||
@props(['tag' => 'button', 'disableWhenLoading' => true]) | ||
|
||
@php | ||
$tag = $attributes->hasAny('href', ':href', 'v-bind:href') ? 'a' : $tag; | ||
$tag = $attributes->has('for') ? 'label' : $tag; | ||
@endphp | ||
|
||
<x-rapidez::tag | ||
is="{{ $tag }}" | ||
{{ $attributes->merge([ | ||
':disabled' => $attributes->has('href') || $attributes->has(':href') || !$disableWhenLoading ? null : '$root.loading']) }} | ||
> | ||
<x-rapidez::button.tag {{ $attributes->twMerge('relative inline-flex items-center justify-center transition font-medium text-base rounded min-h-12 py-1.5 px-5 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer gap-x-1.5') }}> | ||
{{ $slot }} | ||
</x-rapidez::tag> | ||
</x-rapidez::button.tag> |
This file contains hidden or 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,23 @@ | ||
@props(['tag' => 'button', 'disableWhenLoading' => true, 'loader' => false]) | ||
|
||
@php | ||
$tag = $attributes->hasAny('href', ':href', 'v-bind:href') ? 'a' : $tag; | ||
$tag = $attributes->has('for') ? 'label' : $tag; | ||
@endphp | ||
|
||
<x-rapidez::tag | ||
is="{{ $tag }}" | ||
{{ $attributes->merge([ | ||
':disabled' => $attributes->has('href') || $attributes->has(':href') || !$disableWhenLoading ? null : '$root.loading', | ||
]) }} | ||
Roene-JustBetter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> | ||
<span class="contents" @if ($loader) v-bind:class="{'invisible': loading}" @endif> | ||
{{ $slot }} | ||
</span> | ||
|
||
@if ($loader) | ||
<div v-if="loading" class="absolute right-1/2 bottom-1/2 translate-x-1/2 translate-y-1/2" v-cloak> | ||
<x-heroicon-o-arrow-path class="animate-spin size-5"/> | ||
</div> | ||
@endif | ||
Roene-JustBetter marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
</x-rapidez::tag> |
4 changes: 2 additions & 2 deletions
4
.../playwright/cart.spec.js-snapshots/add-product-simple-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
.../playwright/cart.spec.js-snapshots/add-product-simple-1-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
tests/playwright/cart.spec.js-snapshots/add-product-simple-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
tests/playwright/cart.spec.js-snapshots/add-product-simple-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
tests/playwright/cart.spec.js-snapshots/add-product-simple-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
tests/playwright/category.spec.js-snapshots/category-filter-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
tests/playwright/category.spec.js-snapshots/category-filter-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
tests/playwright/category.spec.js-snapshots/category-filter-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...wright/category.spec.js-snapshots/category-pagination-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...wright/category.spec.js-snapshots/category-pagination-1-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
.../playwright/category.spec.js-snapshots/category-pagination-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...s/playwright/category.spec.js-snapshots/category-pagination-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
tests/playwright/category.spec.js-snapshots/category-pagination-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...spec.js-snapshots/category-with-configurable-products-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...spec.js-snapshots/category-with-configurable-products-1-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...gory.spec.js-snapshots/category-with-configurable-products-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...egory.spec.js-snapshots/category-with-configurable-products-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...tegory.spec.js-snapshots/category-with-configurable-products-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...egory.spec.js-snapshots/category-with-simple-products-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...egory.spec.js-snapshots/category-with-simple-products-1-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...t/category.spec.js-snapshots/category-with-simple-products-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ht/category.spec.js-snapshots/category-with-simple-products-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...ght/category.spec.js-snapshots/category-with-simple-products-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...aywright/checkout.spec.js-snapshots/default--as-guest-4-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
...aywright/checkout.spec.js-snapshots/default--as-guest-4-Mobile-Safari-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions
4
tests/playwright/checkout.spec.js-snapshots/default--as-guest-4-chromium-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/checkout.spec.js-snapshots/default--as-guest-4-firefox-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/checkout.spec.js-snapshots/default--as-guest-4-webkit-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...aywright/checkout.spec.js-snapshots/onestep--as-guest-3-Mobile-Chrome-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...aywright/checkout.spec.js-snapshots/onestep--as-guest-3-Mobile-Safari-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/checkout.spec.js-snapshots/onestep--as-guest-3-chromium-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/checkout.spec.js-snapshots/onestep--as-guest-3-firefox-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/checkout.spec.js-snapshots/onestep--as-guest-3-webkit-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/general.spec.js-snapshots/cookie-1-Mobile-Chrome-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/general.spec.js-snapshots/cookie-1-Mobile-Safari-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/general.spec.js-snapshots/cookie-1-chromium-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/general.spec.js-snapshots/cookie-1-firefox-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/general.spec.js-snapshots/cookie-1-webkit-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/homepage.spec.js-snapshots/homepage-1-Mobile-Chrome-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/homepage.spec.js-snapshots/homepage-1-Mobile-Safari-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/homepage.spec.js-snapshots/homepage-1-chromium-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/homepage.spec.js-snapshots/homepage-1-firefox-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/homepage.spec.js-snapshots/homepage-1-webkit-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...wright/product.spec.js-snapshots/product-configurable-1-Mobile-Chrome-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...wright/product.spec.js-snapshots/product-configurable-1-Mobile-Safari-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.../playwright/product.spec.js-snapshots/product-configurable-1-chromium-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...s/playwright/product.spec.js-snapshots/product-configurable-1-firefox-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/product.spec.js-snapshots/product-configurable-1-webkit-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.../playwright/product.spec.js-snapshots/product-grouped-1-Mobile-Chrome-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.../playwright/product.spec.js-snapshots/product-grouped-1-Mobile-Safari-linux.png
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
tests/playwright/product.spec.js-snapshots/product-grouped-1-chromium-linux.png
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.