gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant-backoffice] branch master updated: read currency from /c


From: gnunet
Subject: [taler-merchant-backoffice] branch master updated: read currency from /config
Date: Sat, 09 Apr 2022 10:36:27 +0200

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 de4ab81  read currency from /config
de4ab81 is described below

commit de4ab81b205d221ad55e3abdf5e2940b07496f5a
Author: ms <ms@taler.net>
AuthorDate: Sat Apr 9 10:36:23 2022 +0200

    read currency from /config
---
 packages/bank/src/pages/home/index.tsx | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/packages/bank/src/pages/home/index.tsx 
b/packages/bank/src/pages/home/index.tsx
index 1e7723d..9335322 100644
--- a/packages/bank/src/pages/home/index.tsx
+++ b/packages/bank/src/pages/home/index.tsx
@@ -110,6 +110,10 @@ interface AccountStateType {
  * Helpers. *
  ***********/
 
+async function fetcher(url) {
+  return fetch(url).then((r) => (r.json()));
+}
+
 function genCaptchaNumbers(): string {
   return `${Math.floor(Math.random() * 10)} + ${Math.floor(Math.random() * 
10)}`;
 }
@@ -669,6 +673,16 @@ async function registrationCall(
  * Functional components. *
  *************************/
 
+function Currency(): VNode {
+  const { data, error } = useSWR(`${getRootPath()}integration-api/config`, 
fetcher);
+  if (typeof error !== "undefined") {
+    return <b>error: currency could not be retrieved</b>;
+  }
+  if (typeof data === "undefined") return "...";
+  console.log("found bank config", data);
+  return data.currency;
+}
+
 function ErrorBanner(Props: any): VNode | null {
   const [pageState, pageStateSetter] = Props.pageState;
   const i18n = useTranslator();
@@ -1586,7 +1600,7 @@ export function BankHome(): VNode {
   return (
     <PageContext.Provider value={[pageState, pageStateSetter]}>
       <BankFrame>
-        <h1 class="nav">{i18n`Welcome to the $currency bank!`}</h1>
+        <h1 class="nav">{i18n`Welcome to the euFin bank!`}</h1>
         <LoginForm
             pageStateSetter={pageStateSetter}
             backendStateSetter={backendStateSetter} />
@@ -1594,7 +1608,7 @@ export function BankHome(): VNode {
           If you are a new customer please <a href="#" onClick={() => {
             pageStateSetter((prevState) => ({...prevState, tryRegister: 
true}))}}>register!</a>
        &nbsp;&nbsp; Registration is fast and free, and it gives you a 
registration bonus
-       of 100 $currency
+       of 100 <Currency />
         </Translate></p>
         <p><Translate>To view transactions of public accounts, please <a 
href="#"
           onClick={goPublicAccounts(pageStateSetter)}>click here</a>.

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