aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx')
-rw-r--r--packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
index 4f7b25f6d..e9d254332 100644
--- a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
+++ b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
@@ -458,8 +458,8 @@ export function InputAmount(
if (!onChange) return;
const l = e.currentTarget.value.length
const sep_pos = e.currentTarget.value.indexOf(FRAC_SEPARATOR)
- if (sep_pos !== -1 && l - sep_pos - 1 > config.currency.num_fractional_input_digits) {
- e.currentTarget.value = e.currentTarget.value.substring(0, sep_pos + config.currency.num_fractional_input_digits + 1)
+ if (sep_pos !== -1 && l - sep_pos - 1 > config.currency_specification.num_fractional_input_digits) {
+ e.currentTarget.value = e.currentTarget.value.substring(0, sep_pos + config.currency_specification.num_fractional_input_digits + 1)
}
onChange(e.currentTarget.value);
}}
@@ -470,21 +470,21 @@ export function InputAmount(
);
}
-export function RenderAmount({ value, negative, noCurrency }: { value: AmountJson, negative?: boolean, noCurrency?: boolean }): VNode {
+export function RenderAmount({ value, negative }: { value: AmountJson, negative?: boolean }): VNode {
const { config } = useBankCoreApiContext()
const str = Amounts.stringifyValue(value)
const sep_pos = str.indexOf(FRAC_SEPARATOR)
- if (sep_pos !== -1 && str.length - sep_pos - 1 > config.currency.num_fractional_normal_digits) {
- const limit = sep_pos + config.currency.num_fractional_normal_digits + 1
+ 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
const normal = str.substring(0, limit)
const small = str.substring(limit)
- return <span class="whitespace-nowrap">
+ return <span data-negative={negative} class="whitespace-nowrap data-[negative=true]:bg-red-400">
{negative ? "-" : undefined}
- {noCurrency ? undefined : value.currency} {normal} <sup class="-ml-2">{small}</sup>
+ {value.currency} {normal} <sup class="-ml-1">{small}</sup>
</span>
}
return <span class="whitespace-nowrap">
{negative ? "-" : undefined}
- {noCurrency ? undefined : value.currency} {str}
+ {value.currency} {str}
</span>
} \ No newline at end of file