gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: fix cta navbar and added an w


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix cta navbar and added an withdrawal button when the wallet didnt find a tos (with a warning)
Date: Wed, 13 Oct 2021 14:54:31 +0200

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

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 021d5083 fix cta navbar and added an withdrawal button when the wallet 
didnt find a tos (with a warning)
021d5083 is described below

commit 021d508337490d25f6d7293bf0deadbb5f298f8c
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Oct 13 09:54:18 2021 -0300

    fix cta navbar and added an withdrawal button when the wallet didnt find a 
tos (with a warning)
---
 .../taler-wallet-webextension/src/NavigationBar.tsx    |  1 +
 .../src/components/ExchangeToS.tsx                     |  5 ++++-
 .../taler-wallet-webextension/src/cta/Withdraw.tsx     | 12 ++++++++++--
 .../src/popup/TalerActionFound.tsx                     |  4 ++--
 .../taler-wallet-webextension/src/popupEntryPoint.tsx  | 18 +++++++++---------
 5 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx 
b/packages/taler-wallet-webextension/src/NavigationBar.tsx
index 7039808d..9edd8ca6 100644
--- a/packages/taler-wallet-webextension/src/NavigationBar.tsx
+++ b/packages/taler-wallet-webextension/src/NavigationBar.tsx
@@ -36,6 +36,7 @@ export enum Pages {
   manual_withdraw = '/manual-withdraw',
   settings = '/settings',
   dev = '/dev',
+  cta = '/cta',
   backup = '/backup',
   history = '/history',
   transaction = '/transaction/:tid',
diff --git a/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx 
b/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx
index b7b0d2fd..cfa20280 100644
--- a/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx
+++ b/packages/taler-wallet-webextension/src/components/ExchangeToS.tsx
@@ -21,7 +21,10 @@ import { h } from 'preact';
 export function ExchangeXmlTos({ doc }: { doc: Document }) {
   const termsNode = doc.querySelector('[ids=terms-of-service]')
   if (!termsNode) {
-    return <div>not found</div>
+    return <div>
+      <p>The exchange send us an xml but there is no node with 
'ids=terms-of-service'. This is the content:</p>
+      <pre>{new XMLSerializer().serializeToString(doc)}</pre>
+    </div>
   }
   return <Fragment>
     {Array.from(termsNode.children).map(renderChild)}
diff --git a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx 
b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
index 94f217fc..5ae1e86e 100644
--- a/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
+++ b/packages/taler-wallet-webextension/src/cta/Withdraw.tsx
@@ -214,10 +214,18 @@ export function View({ details, knownExchanges, amount, 
onWithdraw, onSwitchExch
             {i18n.str`Confirm withdrawal`}
           </ButtonSuccess>
         }
-        {terms.status === 'notfound' &&
-          <LinkWarning upperCased>
+        {terms.status === 'notfound' && <Fragment>
+          <LinkWarning>
             {i18n.str`Exchange doesn't have terms of service`}
           </LinkWarning>
+          <ButtonWarning
+            upperCased
+            disabled={!details.exchangeInfo.baseUrl}
+            onClick={onWithdraw}
+          >
+            {i18n.str`Withdraw anyway`}
+          </ButtonWarning>
+        </Fragment>
         }
       </section>
     </WalletAction>
diff --git a/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx 
b/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx
index 4e3c7168..ef0ec341 100644
--- a/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx
+++ b/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx
@@ -3,7 +3,7 @@ import { ButtonPrimary, ButtonSuccess, PopupBox } from 
"../components/styled/ind
 
 export interface Props {
   url: string;
-  onDismiss: (s: boolean) => void;
+  onDismiss: () => void;
 }
 
 export function TalerActionFound({ url, onDismiss }: Props) {
@@ -49,7 +49,7 @@ export function TalerActionFound({ url, onDismiss }: Props) {
     </section>
     <footer>
       <div />
-      <ButtonPrimary onClick={() => onDismiss(true)}> Dismiss </ButtonPrimary>
+      <ButtonPrimary onClick={() => onDismiss()}> Dismiss </ButtonPrimary>
     </footer>
   </PopupBox>;
 
diff --git a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx 
b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
index 33a46214..070df554 100644
--- a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
+++ b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
@@ -66,14 +66,9 @@ if (document.readyState === "loading") {
 function Application() {
   const [talerActionUrl, setDismissed] = useTalerActionURL()
 
-  if (talerActionUrl) {
-    return <div>
-      <WalletNavBar />
-      <div style={{ width: 400, height: 290 }}>
-        <TalerActionFound url={talerActionUrl} onDismiss={setDismissed} />
-      </div>
-    </div>
-  }
+  useEffect(() => {
+    if (talerActionUrl) route(Pages.cta)
+  },[talerActionUrl])
 
   return (
     <div>
@@ -81,11 +76,16 @@ function Application() {
         <WalletNavBar />
         <div style={{ width: 400, height: 290 }}>
           <Router history={createHashHistory()}>
+            <Route path={Pages.dev} component={DeveloperPage} />
+
             <Route path={Pages.balance} component={BalancePage}
               goToWalletManualWithdraw={() => 
goToWalletPage(Pages.manual_withdraw)}
             />
             <Route path={Pages.settings} component={SettingsPage} />
-            <Route path={Pages.dev} component={DeveloperPage} />
+            <Route path={Pages.cta} component={() => <TalerActionFound 
url={talerActionUrl!} onDismiss={() => {
+              setDismissed(true)
+              route(Pages.balance)
+            }} />} />
 
             <Route path={Pages.transaction}
               component={({ tid }: { tid: string }) => 
goToWalletPage(Pages.transaction.replace(':tid', tid))}

-- 
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]