gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant-backoffice] branch master updated: show public histories


From: gnunet
Subject: [taler-merchant-backoffice] branch master updated: show public histories
Date: Wed, 12 Jan 2022 19:24:48 +0100

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository merchant-backoffice.

The following commit(s) were added to refs/heads/master by this push:
     new b269cfe  show public histories
b269cfe is described below

commit b269cfea9ee83e6f6e06a8c5b6c0c3573e666264
Author: ms <ms@taler.net>
AuthorDate: Wed Jan 12 19:24:32 2022 +0100

    show public histories
---
 packages/bank/src/pages/home/index.tsx | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/packages/bank/src/pages/home/index.tsx 
b/packages/bank/src/pages/home/index.tsx
index 76b538d..2a42d03 100644
--- a/packages/bank/src/pages/home/index.tsx
+++ b/packages/bank/src/pages/home/index.tsx
@@ -639,6 +639,31 @@ function SWRWithCredentials(props: any): VNode {
   );
 }
 
+/**
+ * Show histories of public accounts.
+ */
+export function PublicHistories(): VNode {
+
+  const { data, error } = useSWR(`access-api/public-accounts`);
+  if (typeof error !== "undefined") {
+    console.log("account error", error);
+    switch(error.status) {
+      case 404: {
+        return <p>List of public accounts was not found</p>
+      }
+      default: {
+        return <p>List of public accounts could not be retrieved.</p>
+      }
+    }
+  }
+  if (!data) return <p>Loading...</p>
+  var txs = [];
+  for (const account of data.publicAccounts) {
+    txs.push(<Transactions accountLabel={account.accountLabel} pageNumber={0} 
/>)
+  }
+  return <div>{txs}</div>;
+}
+
 /**
  * If the user is logged in, it displays
  * the balance, otherwise it offers to login.
@@ -777,6 +802,10 @@ export function BankHome(): VNode {
             pageStateSetter
           );
         }}>{i18n`Sign in`}</button>
+      <div>
+        <p>{i18n`Public transactions:`}</p>
+       <PublicHistories />
+      </div>
     </Fragment>
   );
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]