From fb22009ec4799a624f00c228fbd7435b44c1cbac Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 10 Jan 2022 16:04:53 -0300
Subject: deposit design from belen, feature missing: kyc

---
 .../src/components/BalanceTable.tsx                | 28 ++++++++--------------
 1 file changed, 10 insertions(+), 18 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/components/BalanceTable.tsx')

diff --git a/packages/taler-wallet-webextension/src/components/BalanceTable.tsx b/packages/taler-wallet-webextension/src/components/BalanceTable.tsx
index 05a7d28dd..c69625cd2 100644
--- a/packages/taler-wallet-webextension/src/components/BalanceTable.tsx
+++ b/packages/taler-wallet-webextension/src/components/BalanceTable.tsx
@@ -14,31 +14,28 @@
  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
-import { amountFractionalBase, Amounts, Balance } from "@gnu-taler/taler-util";
+import { Amounts, amountToPretty, Balance } from "@gnu-taler/taler-util";
 import { h, VNode } from "preact";
-import {
-  ButtonPrimary,
-  TableWithRoundRows as TableWithRoundedRows,
-} from "./styled";
+import { TableWithRoundRows as TableWithRoundedRows } from "./styled";
 
 export function BalanceTable({
   balances,
-  goToWalletDeposit,
+  goToWalletHistory,
 }: {
   balances: Balance[];
-  goToWalletDeposit: (currency: string) => void;
+  goToWalletHistory: (currency: string) => void;
 }): VNode {
-  const currencyFormatter = new Intl.NumberFormat("en-US");
   return (
     <TableWithRoundedRows>
       {balances.map((entry, idx) => {
         const av = Amounts.parseOrThrow(entry.available);
 
-        const v = currencyFormatter.format(
-          av.value + av.fraction / amountFractionalBase,
-        );
         return (
-          <tr key={idx}>
+          <tr
+            key={idx}
+            onClick={() => goToWalletHistory(av.currency)}
+            style={{ cursor: "pointer" }}
+          >
             <td>{av.currency}</td>
             <td
               style={{
@@ -47,12 +44,7 @@ export function BalanceTable({
                 width: "100%",
               }}
             >
-              {v}
-            </td>
-            <td>
-              <ButtonPrimary onClick={() => goToWalletDeposit(av.currency)}>
-                Deposit
-              </ButtonPrimary>
+              {Amounts.stringifyValue(av)}
             </td>
           </tr>
         );
-- 
cgit v1.2.3

