summaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-11-22 15:20:06 -0300
committerSebastian <sebasjm@gmail.com>2023-11-22 15:20:29 -0300
commit305c513c2bcc2b25fe57cf0ed9723781944f9f3f (patch)
tree2022b093f6bed0bfd74c257168033b206850e2b0 /packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
parent33c0267b37eecf44dc9f04e124eb44d27cba700c (diff)
downloadwallet-core-305c513c2bcc2b25fe57cf0ed9723781944f9f3f.tar.gz
wallet-core-305c513c2bcc2b25fe57cf0ed9723781944f9f3f.tar.bz2
wallet-core-305c513c2bcc2b25fe57cf0ed9723781944f9f3f.zip
more cashout ui
Diffstat (limited to 'packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx')
-rw-r--r--packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
index a6282c947..e035c7fed 100644
--- a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
+++ b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
@@ -18,6 +18,7 @@ import {
AmountJson,
AmountString,
Amounts,
+ CurrencySpecification,
Logger,
PaytoString,
TranslatedString,
@@ -470,13 +471,12 @@ export function InputAmount(
);
}
-export function RenderAmount({ value, negative, withColor }: { value: AmountJson, negative?: boolean, withColor?: boolean }): VNode {
- const { config } = useBankCoreApiContext()
+export function RenderAmount({ value, spec, negative, withColor }: { spec: CurrencySpecification; value: AmountJson, negative?: boolean, withColor?: boolean }): VNode {
const neg = !!negative //convert to true or false
const str = Amounts.stringifyValue(value)
const sep_pos = str.indexOf(FRAC_SEPARATOR)
- if (sep_pos !== -1 && str.length - sep_pos - 1 > config.currency_specification.num_fractional_normal_digits) {
- const limit = sep_pos + config.currency_specification.num_fractional_normal_digits + 1
+ if (sep_pos !== -1 && str.length - sep_pos - 1 > spec.num_fractional_normal_digits) {
+ const limit = sep_pos + spec.num_fractional_normal_digits + 1
const normal = str.substring(0, limit)
const small = str.substring(limit)
return <span data-negative={withColor ? neg : undefined} class="whitespace-nowrap data-[negative=false]:text-green-600 data-[negative=true]:text-red-600">