gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant-backoffice] 02/02: move public history to dedicate page


From: gnunet
Subject: [taler-merchant-backoffice] 02/02: move public history to dedicate page
Date: Wed, 09 Feb 2022 12:22:12 +0100

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

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

commit 8d4a44f7faf931f783a34ecc1136d7c23cca0c25
Author: ms <ms@taler.net>
AuthorDate: Wed Feb 9 12:22:01 2022 +0100

    move public history to dedicate page
---
 packages/bank/src/pages/home/index.tsx | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/packages/bank/src/pages/home/index.tsx 
b/packages/bank/src/pages/home/index.tsx
index 60ea692..352650b 100644
--- a/packages/bank/src/pages/home/index.tsx
+++ b/packages/bank/src/pages/home/index.tsx
@@ -59,6 +59,7 @@ interface CredentialsRequestType {
 interface PageStateType {
   isLoggedIn: boolean;
   tryRegister: boolean;
+  showPublicHistories: boolean;
   hasError: boolean;
   withdrawalInProgress: boolean;
   error?: string;
@@ -218,6 +219,7 @@ function usePageState(
   state: PageStateType = {
     isLoggedIn: false,
     tryRegister: false,
+    showPublicHistories: false,
     hasError: false,
     withdrawalInProgress: false,
   }
@@ -689,7 +691,8 @@ function RegistrationForm(Props: any): VNode {
           pageStateSetter
         );}}>{i18n`Register`}</button>
     <a onClick={() => {
-      pageStateSetter((prevState) => ({...prevState, tryRegister: 
false}))}}>Go back</a>
+      pageStateSetter((prevState: PageStateType) =>
+        ({...prevState, tryRegister: false}))}}>Go back</a>
   </Fragment>);
 }
 
@@ -822,7 +825,6 @@ function Account(Props: any): VNode {
     <div>
       <span>{i18n`Last transactions:`}</span> { txsPages }
       <button onClick={() => setTxPageNumber(txPageNumber + 1)}>{i18n`Load 
more transactions`}</button>
-      <button onClick={() => setTxPageNumber(0)}>{i18n`Reset 
transactions`}</button>
     </div>
     {Props.children}
   </Fragment>);
@@ -900,7 +902,9 @@ function PublicHistories(): VNode {
       </div>
     )
   }
-  return <div>{txs}</div>;
+  return <Fragment>
+    {txs.length !== 0 ? txs : <p>No public transactions found.</p>}
+  </Fragment>;
 }
 
 /**
@@ -923,6 +927,15 @@ export function BankHome(): VNode {
     </Fragment>;
   }
 
+  if (pageState.showPublicHistories) {
+    return (<SWRWithoutCredentials baseUrl={getRootPath()}>
+      <PublicHistories />
+      <a onClick={() => {
+        pageStateSetter((prevState: PageStateType) =>
+          ({...prevState, showPublicHistories: false}))}}>Go back</a>
+    </SWRWithoutCredentials>);
+  }
+
   if (pageState.tryRegister) {
     return (<RegistrationForm
       pageState={pageState}
@@ -1059,6 +1072,9 @@ export function BankHome(): VNode {
           backendStateSetter={backendStateSetter} />
        <p>Not a customer yet?  <a onClick={() => {
           pageStateSetter((prevState) => ({...prevState, tryRegister: 
true}))}}>Register!</a></p>
+       <p>See our public <a onClick={() => {
+          pageStateSetter((prevState) => (
+            {...prevState, showPublicHistories: true}))}}>transactions</a></p>
       </SWRWithoutCredentials>
     </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]