From 051d242ad2225014195f0144330837eeac57e423 Mon Sep 17 00:00:00 2001 From: shellyYG <69584196+shellyYG@users.noreply.github.com> Date: Mon, 22 Mar 2021 11:38:11 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20transaction=20remarks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/translations/cn.json | 12 +-- src/i18n/translations/en.json | 14 ++-- src/i18n/translations/zh.json | 12 +-- src/templates/transaction.tsx | 19 +++++ test/__snapshots__/transaction.test.ts.snap | 89 +++++++++++++++++++++ test/stub/samples.ts | 1 + test/transaction.test.ts | 7 +- 7 files changed, 137 insertions(+), 17 deletions(-) diff --git a/src/i18n/translations/cn.json b/src/i18n/translations/cn.json index e9804e8..cd3a3f5 100644 --- a/src/i18n/translations/cn.json +++ b/src/i18n/translations/cn.json @@ -4,11 +4,11 @@ "cta.likecoin-button": "在文章中点击 LikeCoin button,可分配创作基金,额外奖励作者。", + "greeting": "你好 {name}:", + "help.center.text": "帮助中心", "help.center.url": "https://docs.like.co/v/zh", - "greeting": "你好 {name}:", - "report.monthly.date": "{year}年{month}月", "report.monthly.civic-liker.subject": "赞赏公民每月报告 ({date})", @@ -45,16 +45,18 @@ "referral-tx.description.referrer": "user 已因你的推荐下载了 Liker Land。

你们两位各获得 {amount} LikeCoin 奖赏。", "referral-tx.check-wallet": "奖金已转帐至你的钱包,请用 Liker Land app 查看。", - "unsubscribe.text": "取消订阅", - "reset-password.subject": "更改密码操作说明", "reset-password.subtitle": "更改密码操作说明", "reset-password.content": "{name} 您好,



请按以下按键开始更改您的密码", "reset-password.cta": "更改密码", "reset-password.text": "你没有要求修改密码吗?

别人可能不小心把Email地址打错成你的地址。

请忽略此邮件,你的密码将维持不变。", + "resend": "重发", + "transaction.subject": "你已收到 {amount} LikeCoin", "transaction.subtitle": "你已收到 {amount} LikeCoin", "transaction.content": "{name} 你好,



你已收到 {fromUser} 發送的 {amount} LikeCoin。

查阅交易详情:", - "resend": "重发" + "transaction.remarks": "备註: {remarks}", + + "unsubscribe.text": "取消订阅" } diff --git a/src/i18n/translations/en.json b/src/i18n/translations/en.json index c1c8a7c..e0b74bd 100644 --- a/src/i18n/translations/en.json +++ b/src/i18n/translations/en.json @@ -4,13 +4,13 @@ "cta.likecoin-button": "Click the LikeCoin button in any articles, distribute Creators Fund to reward the creators.", - "help.center.text": "Help Center", - "help.center.url": "https://docs.like.co", - "date.month": "Month", "greeting": "Dear {name}", + "help.center.text": "Help Center", + "help.center.url": "https://docs.like.co", + "report.monthly.date": "{month} {year}", "report.monthly.civic-liker.subject": "Civic Liker Monthly Report ({date})", @@ -47,16 +47,18 @@ "referral-tx.description.referrer": "user has installed Liker Land app because of you.

You both received {amount} LikeCoin as rewards.", "referral-tx.check-wallet": "The rewards had been transferred to your wallet, you may open the Liker Land app and check.", - "unsubscribe.text": "Unsubscribe", - "reset-password.subject": "Reset Password Instruction", "reset-password.subtitle": "Reset Password Instruction", "reset-password.content": "Hi {name},



You can continue reset password through this button ", "reset-password.cta": "Reset password", "reset-password.text": "Didn’t request this email?

Your address may have been entered by mistake.

Simply ignore this email and nothing further will happen.", + "resend": "Resend", + "transaction.subject": "You have received {amount} LikeCoin", "transaction.subtitle": "You have received {amount} LikeCoin", "transaction.content": "Hi {name},



You have received {amount} LikeCoin from {fromUser}.

Check the transaction details: ", - "resend": "Resend" + "transaction.remarks": "Remarks: {remarks}", + + "unsubscribe.text": "Unsubscribe" } diff --git a/src/i18n/translations/zh.json b/src/i18n/translations/zh.json index 6c7beb9..19ffe2b 100644 --- a/src/i18n/translations/zh.json +++ b/src/i18n/translations/zh.json @@ -4,11 +4,11 @@ "cta.likecoin-button": "在文章中點擊 LikeCoin button,可分配創作基金,額外奬勵作者。", + "greeting": "你好 {name}:", + "help.center.text": "幫助中心", "help.center.url": "https://docs.like.co/v/zh", - "greeting": "你好 {name}:", - "report.monthly.date": "{year}年{month}月", "report.monthly.civic-liker.subject": "讚賞公民每月報告 ({date})", @@ -45,16 +45,18 @@ "referral-tx.description.referrer": "user 已因你的推薦下載了 Liker Land。

你們兩位各獲得 {amount} LikeCoin 奬賞。", "referral-tx.check-wallet": "奬金已轉帳至你的錢包,請用 Liker Land app 查看。", - "unsubscribe.text": "取消訂閱", - "reset-password.subject": "更改密碼操作說明", "reset-password.subtitle": "更改密碼操作說明", "reset-password.content": "{name} 您好,



請按以下按鍵開始更改您的密碼", "reset-password.cta": "更改密碼", "reset-password.text": "您沒有要求修改密碼嗎?

別人可能不小心把Email打錯成您的Email。

請忽略此郵件,您的密碼將維持不變。", + + "resend": "重發", "transaction.subject": "您已收到 {amount} LikeCoin", "transaction.subtitle": "您已收到 {amount} LikeCoin", "transaction.content": "{name} 您好,



您已收到 {fromUser} 發送的 {amount} LikeCoin。

查閱交易詳情: ", - "resend": "重發" + "transaction.remarks": "備註: {remarks}", + + "unsubscribe.text": "取消訂閱" } diff --git a/src/templates/transaction.tsx b/src/templates/transaction.tsx index 61fd03f..04de76e 100644 --- a/src/templates/transaction.tsx +++ b/src/templates/transaction.tsx @@ -19,6 +19,7 @@ export interface TransactionTemplateProps { viewTxURL?: string; amount: string; isResend?: boolean; + remarks?: string; } export const TransactionTemplate = ({ @@ -28,6 +29,7 @@ export const TransactionTemplate = ({ fromDisplayName, viewTxURL, amount, + remarks, }: TransactionTemplateProps) => { return ( @@ -112,6 +114,23 @@ export const TransactionTemplate = ({ + + + + + + + diff --git a/test/__snapshots__/transaction.test.ts.snap b/test/__snapshots__/transaction.test.ts.snap index d4c628a..96a6a97 100644 --- a/test/__snapshots__/transaction.test.ts.snap +++ b/test/__snapshots__/transaction.test.ts.snap @@ -650,6 +650,95 @@ exports[`Render new transaction templates Default 1`] = ` +
+
+ + + + + + +
+ + +
+ + + + + + + +
+ + + + + + + +
+ +
Remarks: likecoin remark
+ +
+ +
+ +
+ + +
+
+
+ + +
{ it('Default', () => { @@ -11,6 +15,7 @@ describe('Render new transaction templates', () => { fromDisplayName: SAMPLE_LIKER_DISPLAY_NAME, viewTxURL: SAMPLE_URL, amount: '100', + remarks: SAMPLE_REMARK, }, { minify: false } );