Skip to content

Commit

Permalink
feat: display basket loading only on items list
Browse files Browse the repository at this point in the history
  • Loading branch information
SGrueber authored and MaxKless committed Jul 27, 2022
1 parent afd7995 commit 1cabc4b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/app/pages/basket/basket-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@

<ng-container *ngIf="basket$ | async as basket; else emptyBasket">
<ng-container *ngIf="basket.lineItems.length; else emptyBasket">
<ish-shopping-basket [basket]="basket" [error]="basketError$ | async" (nextStep)="nextStep()"></ish-shopping-basket>
<ish-shopping-basket
[basket]="basket"
[error]="basketError$ | async"
[loading]="basketLoading$ | async"
(nextStep)="nextStep()"
></ish-shopping-basket>
</ng-container>
</ng-container>

<ng-template #emptyBasket>
<ish-shopping-basket-empty [error]="basketError$ | async"></ish-shopping-basket-empty>
</ng-template>

<ish-loading *ngIf="basketLoading$ | async"></ish-loading>
<ish-loading *ngIf="basketLoading$ | async"></ish-loading>
</ng-template>

<ish-lazy-recently-viewed></ish-lazy-recently-viewed>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ <h1 class="d-flex flex-wrap align-items-baseline">
<ish-line-item-list *ngIf="basket" [lineItems]="basket.lineItems"></ish-line-item-list>
</ng-template>

<ish-loading *ngIf="loading"></ish-loading>

<div class="button-group">
<ish-lazy-basket-add-to-quote></ish-lazy-basket-add-to-quote>
<ish-lazy-basket-create-order-template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { HttpError } from 'ish-core/models/http-error/http-error.model';
export class ShoppingBasketComponent {
@Input() basket: BasketView;
@Input() error: HttpError;
@Input() loading = false;

@Output() nextStep = new EventEmitter<void>();

Expand Down

0 comments on commit 1cabc4b

Please sign in to comment.