Skip to content

Commit

Permalink
Update UX for quick order list mobile view: show loading spinner, hid…
Browse files Browse the repository at this point in the history
…e remove all if there are no variants in the cart (#3733)
  • Loading branch information
lhoffbeck authored Feb 26, 2025
1 parent e1f06f4 commit 4225095
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions assets/quick-order-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ quick-order-list .pagination-wrapper {
height: 1.5rem;
}

.quick-order-list-total__column.large-up-hide .loading__spinner {
margin-top: 2.5rem;
}

quick-order-list-remove-all-button {
margin-left: -1.5rem;
margin-top: 1rem;
Expand Down Expand Up @@ -543,6 +547,16 @@ quick-order-list .pagination-wrapper {
}
}

.quick-order-list-total__column.large-up-hide .variant-remove-total {
display: flex;
justify-content: center;
margin: 0;

.loading__spinner {
margin-top: 1.5rem;
}
}

.quick-order-list__total-items {
display: flex;
align-items: center;
Expand Down
4 changes: 3 additions & 1 deletion assets/quick-order-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,9 @@ if (!customElements.get('quick-order-list')) {

toggleLoading(loading, target = this) {
target.querySelector('#shopping-cart-variant-item-status').toggleAttribute('aria-hidden', !loading);
target.querySelector('.variant-remove-total .loading__spinner')?.classList.toggle('hidden', !loading);
target
.querySelectorAll('.variant-remove-total .loading__spinner')
?.forEach((spinner) => spinner.classList.toggle('hidden', !loading));
}
}
);
Expand Down
2 changes: 1 addition & 1 deletion snippets/quick-order-list.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
<div class="variant-remove-total">
{%- render 'loading-spinner' -%}
<quick-order-list-remove-all-button
class="no-js-hidden"
class="{% if items_in_cart == 0 %}hidden{% endif %}"
data-action="confirm"
>
<button class="button button--tertiary" type="button">
Expand Down

0 comments on commit 4225095

Please sign in to comment.