Skip to content

Commit

Permalink
Merge pull request #794 from langx:xuelink/issue790
Browse files Browse the repository at this point in the history
Tap and Detailed version of Checkout as a Popup
  • Loading branch information
xuelink authored Jun 11, 2024
2 parents 80d8169 + 6335f96 commit ee5eb12
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 2 deletions.
2 changes: 1 addition & 1 deletion appwrite.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"execute": [],
"events": [],
"schedule": "0 0 * * *",
"timeout": 15,
"timeout": 59,
"enabled": true,
"logging": true,
"entrypoint": "src/main.js",
Expand Down
1 change: 1 addition & 0 deletions functions/token-checkout/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ async function processDocuments(
streak: doc.streak,
badges: doc.badges,
onlineMin: doc.onlineMin,
totalAmount: TEST_DAILY_TOKEN,
date: new Date().toISOString(),
},
[Permission.read(Role.user(doc.$id))]
Expand Down
72 changes: 71 additions & 1 deletion src/app/components/checkout-list/checkout-list.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ion-item *ngIf="item">
<ion-item *ngIf="item" [id]="item.$id" detail>
<ion-thumbnail slot="start">
<img
src="/assets/image/token.png"
Expand All @@ -16,3 +16,73 @@ <h2><b>Amount:</b> {{ item.amount }}</h2>
</p>
</ion-label>
</ion-item>
<ion-modal
#modal
[trigger]="item.$id"
[initialBreakpoint]="0.6"
[breakpoints]="[0, 0.6, 0.8, 1]"
>
<ng-template>
<ion-header>
<ion-toolbar>
<ion-title>Details</ion-title>
<ion-buttons slot="end">
<ion-button (click)="modal.dismiss()">Close</ion-button>
</ion-buttons>
</ion-toolbar>
</ion-header>

<ion-content>
<ion-list>
<ion-item>
<ion-label> <strong>Amount:</strong> {{ item?.amount }} </ion-label>
</ion-item>
<ion-item>
<ion-label>
<strong>Distribution:</strong> {{ item?.distribution }}
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<strong>Base Amount:</strong> {{ item?.baseAmount }}
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<strong>Text Message:</strong> {{ item?.text }}
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<strong>Image Message:</strong> {{ item?.image }}
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<strong>Audio Message:</strong> {{ item?.audio }}
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<strong>Day Streak:</strong> {{ item?.streak }}
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<strong>Badges-Bonus:</strong> {{ item?.badges }}
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<strong>Online Minutes:</strong> {{ item?.onlineMin }}
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<strong>Total Daily Amount</strong> {{ item?.totalAmount }}
</ion-label>
</ion-item>
</ion-list>
</ion-content>
</ng-template>
</ion-modal>
4 changes: 4 additions & 0 deletions src/app/components/checkout-list/checkout-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export class CheckoutListComponent implements OnInit {

ngOnInit() {}

//
// Utils
//

getPercentage(distribution: number): string {
return (distribution * 100).toFixed(2) + '%';
}
Expand Down
1 change: 1 addition & 0 deletions src/app/models/Checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ export type Checkout = Models.Document & {
badges?: number;
onlineMin?: number;
date?: Date;
totalAmount?: number;
};

0 comments on commit ee5eb12

Please sign in to comment.