aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/pages/admin/AdminHome.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/admin/AdminHome.tsx
parent33c0267b37eecf44dc9f04e124eb44d27cba700c (diff)
downloadwallet-core-305c513c2bcc2b25fe57cf0ed9723781944f9f3f.tar.xz
more cashout ui
Diffstat (limited to 'packages/demobank-ui/src/pages/admin/AdminHome.tsx')
-rw-r--r--packages/demobank-ui/src/pages/admin/AdminHome.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/demobank-ui/src/pages/admin/AdminHome.tsx b/packages/demobank-ui/src/pages/admin/AdminHome.tsx
index 795a2c6d0..e9fa1dc47 100644
--- a/packages/demobank-ui/src/pages/admin/AdminHome.tsx
+++ b/packages/demobank-ui/src/pages/admin/AdminHome.tsx
@@ -7,6 +7,7 @@ import { useLastMonitorInfo } from "../../hooks/circuit.js";
import { RenderAmount } from "../PaytoWireTransferForm.js";
import { WireTransfer } from "../WireTransfer.js";
import { AccountList } from "./AccountList.js";
+import { useBankCoreApiContext } from "../../context/config.js";
/**
* Query account information and show QR code if there is pending withdrawal
@@ -42,7 +43,6 @@ function Metrics(): VNode {
const [metricType, setMetricType] = useState<TalerCorebankApi.MonitorTimeframeParam>(TalerCorebankApi.MonitorTimeframeParam.day);
const resp = useLastMonitorInfo(new Date(), metricType);
- console.log(resp)
if (!resp) return <Fragment />;
if (resp instanceof TalerError) {
return <ErrorLoading error={resp} />
@@ -162,6 +162,7 @@ function Metrics(): VNode {
function MetricValue({ current, previous }: { current: AmountString | undefined, previous: AmountString | undefined }): VNode {
const { i18n } = useTranslationContext()
+ const {config} = useBankCoreApiContext();
const cmp = current && previous ? Amounts.cmp(current, previous) : 0;
const currAmount = !current ? undefined : Number.parseFloat(Amounts.stringifyValue(current))
const prevAmount = !previous ? undefined : Number.parseFloat(Amounts.stringifyValue(previous))
@@ -173,11 +174,11 @@ function MetricValue({ current, previous }: { current: AmountString | undefined,
const rateStr = `${(Math.abs(rate) * 100).toFixed(2)}%`
return <dd class="mt-1 flex justify-between md:block lg:flex">
<div class="flex justify-start items-baseline text-2xl font-semibold text-indigo-600">
- {!current ? "-" : <RenderAmount value={Amounts.parseOrThrow(current)} />}
+ {!current ? "-" : <RenderAmount value={Amounts.parseOrThrow(current)} spec={config.currency_specification} />}
</div>
<div class="flex justify-end items-baseline text-2xl font-semibold text-indigo-600">
<small class="ml-2 text-sm font-medium text-gray-500">
- <i18n.Translate>from</i18n.Translate> {!previous ? "-" : <RenderAmount value={Amounts.parseOrThrow(previous)} />}
+ <i18n.Translate>from</i18n.Translate> {!previous ? "-" : <RenderAmount value={Amounts.parseOrThrow(previous)} spec={config.currency_specification}/>}
</small>
</div>