Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Commit

Permalink
add product and products as html template
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuamshana committed Jun 26, 2022
1 parent 59105e4 commit b4dc3c4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
13 changes: 13 additions & 0 deletions projects/web/src/componets/product.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="product-item" routerLink="/shops/{{product.shop.projectId}}"
[queryParams]="{product:product.product}">
<img *ngIf="!noImage" (error)="hideImage()" [src]="product.images[0]" alt="{{product.product}}" />
<div [class]="!noImage?'product-item-detail':'product-item-detail-no-image'">
<p [style]="noImage?{color: '#f5f5f5'}:{}" class="product-item-detail-category">{{product.product}}</p>
<p [style]="noImage?{color: 'white'}:{}" class="product-item-detail-price">{{product.retailPrice | currency:
'TZS '}}</p>
</div>
<a routerLink="/shops/{{product.shop.projectId}}" [queryParams]="{product:product.product}"
class="product-item-detail-link">
by {{product.shop.businessName}}
</a>
</div>
15 changes: 15 additions & 0 deletions projects/web/src/componets/products.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div infiniteScroll [infiniteScrollDistance]="5" [infiniteScrollThrottle]="50" [scrollWindow]="false"
(scrolled)="onScroll()" class="products-container">
<app-join-promotion></app-join-promotion>
<div class="products-container">
<app-product [product]="product" *ngFor="let product of mallState.products | async"></app-product>
</div>
<div *ngIf="showLoadMore" class="load-more">
<button (click)="onScroll()" mat-button color="primary" *ngIf="(mallState.loadProducts |async) === false">
Load More
</button>
<mat-progress-spinner *ngIf="(mallState.loadProducts | async) === true" [diameter]="20" color="primary"
mode="indeterminate">
</mat-progress-spinner>
</div>
</div>

0 comments on commit b4dc3c4

Please sign in to comment.