From 1bcc5022c27fff2c28c38b3db12ac353cc7d3481 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Tue, 12 Dec 2017 15:38:03 +0100
Subject: show tip in history

---
 src/webex/pages/popup.tsx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'src/webex/pages/popup.tsx')

diff --git a/src/webex/pages/popup.tsx b/src/webex/pages/popup.tsx
index 82f3eddaa..389be3b5c 100644
--- a/src/webex/pages/popup.tsx
+++ b/src/webex/pages/popup.tsx
@@ -401,6 +401,18 @@ function formatHistoryItem(historyItem: HistoryRecord) {
         </i18n.Translate>
       );
     }
+    case "tip": {
+      const tipPageUrl = new URI(chrome.extension.getURL("/src/webex/pages/tip.html"));
+      const params = { tip_id: d.tipId, merchant_domain: d.merchantDomain };
+      const url = tipPageUrl.query(params).href();
+      return (
+        <i18n.Translate wrap="p">
+          Merchant <span>{d.merchantDomain}</span> gave a <a href={url} onClick={openTab(url)}> tip</a> of <span>{renderAmount(d.amount)}</span>.
+          <span> </span>
+          {d.accepted ? null : <span>You did not accepted the tip yet.</span> }
+        </i18n.Translate>
+      );
+    }
     default:
       return (<p>{i18n.str`Unknown event (${historyItem.type})`}</p>);
   }
-- 
cgit v1.2.3

