aboutsummaryrefslogtreecommitdiff
path: root/packages/demobank-ui/src/components/Transactions/views.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/components/Transactions/views.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/components/Transactions/views.tsx')
-rw-r--r--packages/demobank-ui/src/components/Transactions/views.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/demobank-ui/src/components/Transactions/views.tsx b/packages/demobank-ui/src/components/Transactions/views.tsx
index 72dd43415..1613cb06a 100644
--- a/packages/demobank-ui/src/components/Transactions/views.tsx
+++ b/packages/demobank-ui/src/components/Transactions/views.tsx
@@ -19,6 +19,7 @@ import { format } from "date-fns";
import { Fragment, h, VNode } from "preact";
import { doAutoFocus, RenderAmount } from "../../pages/PaytoWireTransferForm.js";
import { State } from "./index.js";
+import { useBankCoreApiContext } from "../../context/config.js";
export function LoadingUriView({ error }: State.LoadingUriError): VNode {
const { i18n } = useTranslationContext();
@@ -32,6 +33,7 @@ export function LoadingUriView({ error }: State.LoadingUriError): VNode {
export function ReadyView({ transactions, onNext, onPrev }: State.Ready): VNode {
const { i18n } = useTranslationContext();
+ const {config} = useBankCoreApiContext();
if (!transactions.length) return <div />
const txByDate = transactions.reduce((prev, cur) => {
const d = cur.when.t_ms === "never"
@@ -78,7 +80,7 @@ export function ReadyView({ transactions, onNext, onPrev }: State.Ready): VNode
<dd class="mt-1 truncate text-gray-700">
{item.negative ? i18n.str`sent` : i18n.str`received`} {item.amount ? (
<span data-negative={item.negative ? "true" : "false"} class="data-[negative=false]:text-green-600 data-[negative=true]:text-red-600">
- <RenderAmount value={item.amount} />
+ <RenderAmount value={item.amount} spec={config.currency_specification}/>
</span>
) : (
<span style={{ color: "grey" }}>&lt;{i18n.str`invalid value`}&gt;</span>
@@ -99,7 +101,7 @@ export function ReadyView({ transactions, onNext, onPrev }: State.Ready): VNode
</td>
<td data-negative={item.negative ? "true" : "false"}
class="hidden sm:table-cell px-3 py-3.5 text-sm text-gray-500 ">
- {item.amount ? (<RenderAmount value={item.amount} negative={item.negative} withColor />
+ {item.amount ? (<RenderAmount value={item.amount} negative={item.negative} withColor spec={config.currency_specification}/>
) : (
<span style={{ color: "grey" }}>&lt;{i18n.str`invalid value`}&gt;</span>
)}