Skip to content

Commit 4225095

Browse files
authored
Update UX for quick order list mobile view: show loading spinner, hide remove all if there are no variants in the cart (#3733)
1 parent e1f06f4 commit 4225095

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

assets/quick-order-list.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ quick-order-list .pagination-wrapper {
219219
height: 1.5rem;
220220
}
221221

222+
.quick-order-list-total__column.large-up-hide .loading__spinner {
223+
margin-top: 2.5rem;
224+
}
225+
222226
quick-order-list-remove-all-button {
223227
margin-left: -1.5rem;
224228
margin-top: 1rem;
@@ -543,6 +547,16 @@ quick-order-list .pagination-wrapper {
543547
}
544548
}
545549

550+
.quick-order-list-total__column.large-up-hide .variant-remove-total {
551+
display: flex;
552+
justify-content: center;
553+
margin: 0;
554+
555+
.loading__spinner {
556+
margin-top: 1.5rem;
557+
}
558+
}
559+
546560
.quick-order-list__total-items {
547561
display: flex;
548562
align-items: center;

assets/quick-order-list.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ if (!customElements.get('quick-order-list')) {
432432

433433
toggleLoading(loading, target = this) {
434434
target.querySelector('#shopping-cart-variant-item-status').toggleAttribute('aria-hidden', !loading);
435-
target.querySelector('.variant-remove-total .loading__spinner')?.classList.toggle('hidden', !loading);
435+
target
436+
.querySelectorAll('.variant-remove-total .loading__spinner')
437+
?.forEach((spinner) => spinner.classList.toggle('hidden', !loading));
436438
}
437439
}
438440
);

snippets/quick-order-list.liquid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
<div class="variant-remove-total">
234234
{%- render 'loading-spinner' -%}
235235
<quick-order-list-remove-all-button
236-
class="no-js-hidden"
236+
class="{% if items_in_cart == 0 %}hidden{% endif %}"
237237
data-action="confirm"
238238
>
239239
<button class="button button--tertiary" type="button">

0 commit comments

Comments
 (0)