From f65b5cd25613ff869975b911d32f79ba2c51765a Mon Sep 17 00:00:00 2001 From: Sean Wu Date: Wed, 3 Feb 2021 11:00:11 +0800 Subject: [PATCH] Display stroked status style if the asset is not owned by the user. (#526) --- .../transaction-details/transaction-details.page.scss | 7 ++++++- .../transaction-details/transaction-details.page.ts | 6 +++++- src/app/features/home/transaction/transaction.page.scss | 7 ++++++- src/assets/i18n/en-us.json | 1 + src/assets/i18n/zh-tw.json | 1 + 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/app/features/home/transaction/transaction-details/transaction-details.page.scss b/src/app/features/home/transaction/transaction-details/transaction-details.page.scss index 40b1a1188..0443437e5 100644 --- a/src/app/features/home/transaction/transaction-details/transaction-details.page.scss +++ b/src/app/features/home/transaction/transaction-details/transaction-details.page.scss @@ -73,9 +73,14 @@ mat-toolbar { button.returned { color: white; - border-color: var(--ion-color-danger); + border-color: #e31587; background-color: #e31587; } + + button.missed { + color: #e31587; + border-color: #e31587; + } } .column { diff --git a/src/app/features/home/transaction/transaction-details/transaction-details.page.ts b/src/app/features/home/transaction/transaction-details/transaction-details.page.ts index b0eaa7072..7e5350858 100644 --- a/src/app/features/home/transaction/transaction-details/transaction-details.page.ts +++ b/src/app/features/home/transaction/transaction-details/transaction-details.page.ts @@ -41,7 +41,10 @@ export async function getStatus( ) { const resolvedEmail = await email; if (transaction.expired) { - return Status.Returned; + if (transaction.sender === resolvedEmail) { + return Status.Returned; + } + return Status.Missed; } if (!transaction.fulfilled_at) { if (transaction.receiver_email === resolvedEmail) { @@ -59,6 +62,7 @@ enum Status { waitingToBeAccepted = 'waitingToBeAccepted', InProgress = 'inProgress', Returned = 'returned', + Missed = 'missed', Delivered = 'delivered', Accepted = 'accepted', } diff --git a/src/app/features/home/transaction/transaction.page.scss b/src/app/features/home/transaction/transaction.page.scss index 9286331e9..96b7244ed 100644 --- a/src/app/features/home/transaction/transaction.page.scss +++ b/src/app/features/home/transaction/transaction.page.scss @@ -61,8 +61,13 @@ mat-toolbar { button.returned { color: white; - border-color: var(--ion-color-danger); + border-color: #e31587; background-color: #e31587; } + + button.missed { + color: #e31587; + border-color: #e31587; + } } } diff --git a/src/assets/i18n/en-us.json b/src/assets/i18n/en-us.json index f4e5d25e9..c1ea1a82a 100644 --- a/src/assets/i18n/en-us.json +++ b/src/assets/i18n/en-us.json @@ -146,6 +146,7 @@ "accepted": "Accepted", "delivered": "Delivered", "returned": "Returned", + "missed": "Returned", "inProgress": "In Progress", "waitingToBeAccepted": "In Progress", "null": "Not Provided" diff --git a/src/assets/i18n/zh-tw.json b/src/assets/i18n/zh-tw.json index 5804edcab..090b9fe97 100644 --- a/src/assets/i18n/zh-tw.json +++ b/src/assets/i18n/zh-tw.json @@ -145,6 +145,7 @@ "accepted": "已接收", "delivered": "已送出", "returned": "已退回", + "missed": "已退回", "inProgress": "等待中", "waitingToBeAccepted": "等待中", "null": "未提供"