gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant-backoffice] branch master updated: fix about currency be


From: gnunet
Subject: [taler-merchant-backoffice] branch master updated: fix about currency being hard coded
Date: Mon, 17 May 2021 21:59:43 +0200

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

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

The following commit(s) were added to refs/heads/master by this push:
     new 7fb9bb8  fix about currency being hard coded
7fb9bb8 is described below

commit 7fb9bb8fa0ebbc05411a0fbbc799ce4e1bf0e4a7
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon May 17 16:57:28 2021 -0300

    fix about currency being hard coded
---
 .../frontend/src/paths/instance/reserves/create/CreatePage.tsx    | 7 +++++--
 .../frontend/src/paths/instance/transfers/create/CreatePage.tsx   | 8 +++++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git 
a/packages/frontend/src/paths/instance/reserves/create/CreatePage.tsx 
b/packages/frontend/src/paths/instance/reserves/create/CreatePage.tsx
index 3531aae..6c32a15 100644
--- a/packages/frontend/src/paths/instance/reserves/create/CreatePage.tsx
+++ b/packages/frontend/src/paths/instance/reserves/create/CreatePage.tsx
@@ -24,6 +24,7 @@ import { useState } from "preact/hooks";
 import { FormErrors, FormProvider } from 
"../../../../components/form/FormProvider";
 import { Input } from "../../../../components/form/Input";
 import { InputCurrency } from "../../../../components/form/InputCurrency";
+import { useConfigContext } from "../../../../context/config";
 import { MerchantBackend } from "../../../../declaration";
 import { Translate, useTranslator } from "../../../../i18n";
 
@@ -36,14 +37,16 @@ interface Props {
 
 
 export function CreatePage({ onCreate, onBack }: Props): VNode {
+  const { currency } = useConfigContext()
+
   const [reserve, setReserve] = useState<Partial<Entity>>({
-    initial_balance: 'COL:2',
+    initial_balance: `${currency}:2`,
     exchange_url: 'http://exchange.taler:8081/',
     wire_method: 'x-taler-bank',
   })
   const i18n = useTranslator()
 
-  const errors : FormErrors<Entity> = {
+  const errors: FormErrors<Entity> = {
 
   }
 
diff --git 
a/packages/frontend/src/paths/instance/transfers/create/CreatePage.tsx 
b/packages/frontend/src/paths/instance/transfers/create/CreatePage.tsx
index 52cf4e4..cffe0c1 100644
--- a/packages/frontend/src/paths/instance/transfers/create/CreatePage.tsx
+++ b/packages/frontend/src/paths/instance/transfers/create/CreatePage.tsx
@@ -25,6 +25,7 @@ import { FormErrors, FormProvider } from 
"../../../../components/form/FormProvid
 import { Input } from "../../../../components/form/Input";
 import { InputCurrency } from "../../../../components/form/InputCurrency";
 import { InputWithAddon } from "../../../../components/form/InputWithAddon";
+import { useConfigContext } from "../../../../context/config";
 import { MerchantBackend } from "../../../../declaration";
 import { Translate, useTranslator } from "../../../../i18n";
 import { CROCKFORD_BASE32_REGEX, URL_REGEX } from 
"../../../../utils/constants";
@@ -38,14 +39,15 @@ interface Props {
 
 export function CreatePage({ onCreate, onBack }: Props): VNode {
   const i18n = useTranslator()
+  const { currency } = useConfigContext()
 
   const [state, setState] = useState<Partial<Entity>>({
     wtid: 'DCMGEM7F0DPW930M06C2AVNC6CFXT6HBQ2YVQH7EC8ZQ0W8SS9TG',
     payto_uri: 'payto://x-taler-bank/bank.taler:5882/blogger',
     exchange_url: 'http://exchange.taler:8081/',
-    credit_amount: 'COL:22.80'
-  })
-
+    credit_amount: `${currency}:22.80`,
+  });
+  
   const errors: FormErrors<Entity> = {
     wtid: !state.wtid ? i18n`cannot be empty` :
       (!CROCKFORD_BASE32_REGEX.test(state.wtid) ? i18n`check the id, doest 
look valid` :

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