Browse Source

active coupon page style revert

devBranch
Benjamin Arhen 3 years ago
parent
commit
6e58504a9d
  1. 61
      src/app/pages/admin/Coupons/Active/active-coupons.component.html
  2. 1
      src/app/pages/admin/Coupons/Active/active-coupons.component.ts

61
src/app/pages/admin/Coupons/Active/active-coupons.component.html

@ -1,7 +1,7 @@
<div class="xl:col-span-2 flex flex-col flex-auto bg-card shadow rounded-2xl overflow-hidden">
<div class="overflow-x-auto mx-6 py-10">
<table class="w-full bg-transparent" mat-table matSort [dataSource]="couponsDataSource" [trackBy]="trackByFn"
#couponsTable *ngIf="!isScreenSmall">
#couponsTable >
<!-- Transaction ID -->
<ng-container matColumnDef="product">
<th mat-header-cell mat-sort-header *matHeaderCellDef>
@ -123,65 +123,6 @@
<tr class="coupons-row h-14" mat-row *matRowDef="let row; columns: couponsTableColumns;"></tr>
<tr class="h-16 border-0" mat-footer-row *matFooterRowDef="['recentOrdersTableFooter']"></tr>
</table>
<table class="w-full bg-transparent" mat-table matSort [dataSource]="couponsDataSource" [trackBy]="trackByFn"
#couponsTable *ngIf="isScreenSmall">
<!-- Transaction ID -->
<ng-container matColumnDef="product">
<th mat-header-cell mat-sort-header *matHeaderCellDef>
Coupons
</th>
<td mat-cell *matCellDef="let transaction">
<div style="display: grid;">
<span class="pr-6 whitespace-nowrap">
{{transaction.targetProduct |couponProductShort}}
</span>
<span class="pr-6 whitespace-nowrap">
{{transaction.quantity}} left
</span>
<span class="pr-6 whitespace-wrap"
style="display: flex;justify-content: center;font-weight: bold;"
*ngIf="!transaction.type.includes('FREEBIES')">
{{transaction.lower}} - {{transaction.upper}}
</span>
<span class="pr-6 whitespace-wrap"
style="display: flex;justify-content: center;font-weight: bold;"
*ngIf="transaction.type.includes('FREEBIES')">
{{transaction.type}}
</span>
</div>
</td>
</ng-container>
<ng-container matColumnDef="status">
<th mat-header-cell mat-sort-header *matHeaderCellDef>
</th>
<td mat-cell *matCellDef="let transaction">
<div style="display: grid;">
<span class="whitespace-wrap">
Active
</span>
<span class="whitespace-wrap">
{{transaction.expiration | date:"dd-MM-yyyy"}}
</span>
</div>
</td>
</ng-container>
<!-- Amount -->
<!-- Footer -->
<ng-container matColumnDef="recentOrdersTableFooter">
<td class="py-6 px-0 border-0" mat-footer-cell *matFooterCellDef colspan="6">
<mat-paginator style="position:sticky;bottom: 0;width: 100%;" [pageSize]="20"
[pageSizeOptions]="[10, 20, 25,50, 100]" [showFirstLastButtons]="true"></mat-paginator>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="couponsTableColumnsMobile"></tr>
<tr class="coupons-row h-14" mat-row *matRowDef="let row; columns: couponsTableColumnsMobile;"></tr>
<tr class="h-16 border-0" mat-footer-row *matFooterRowDef="['recentOrdersTableFooter']"></tr>
</table>
</div>
</div>

1
src/app/pages/admin/Coupons/Active/active-coupons.component.ts

@ -21,7 +21,6 @@ import { DetailsDialogComponent } from '../DetailsDialog/details-dialog.componen
export class ActiveCouponsComponent implements OnInit, AfterViewInit {
@Input() couponsDataSource: MatTableDataSource<any>;
couponsTableColumns: string[] = ['product', 'quantity', 'type', 'condition', 'range', 'claimed', 'status', 'expiration', 'actions'];
couponsTableColumnsMobile: string[] = ['product', 'status'];
@ViewChild('couponsTable', { read: MatSort }) couponsTableMatSort: MatSort;
isScreenSmall: boolean;
@ViewChild(MatPaginator) paginator: MatPaginator;

Loading…
Cancel
Save