show amount nicely, into a component
This commit is contained in:
parent
df7c249c95
commit
2bd6dae00d
12
packages/taler-wallet-webextension/src/components/Amount.tsx
Normal file
12
packages/taler-wallet-webextension/src/components/Amount.tsx
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { AmountJson, Amounts, AmountString } from "@gnu-taler/taler-util";
|
||||||
|
import { h, VNode, Fragment } from "preact";
|
||||||
|
|
||||||
|
export function Amount({ value }: { value: AmountJson | AmountString }): VNode {
|
||||||
|
const aj = Amounts.jsonifyAmount(value);
|
||||||
|
const amount = Amounts.stringifyValue(aj, 2);
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
{amount} {aj.currency}
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
}
|
@ -23,7 +23,7 @@ export function ErrorMessage({
|
|||||||
description,
|
description,
|
||||||
}: {
|
}: {
|
||||||
title: VNode;
|
title: VNode;
|
||||||
description?: string;
|
description?: string | VNode;
|
||||||
}): VNode | null {
|
}): VNode | null {
|
||||||
const [showErrorDetail, setShowErrorDetail] = useState(false);
|
const [showErrorDetail, setShowErrorDetail] = useState(false);
|
||||||
return (
|
return (
|
||||||
|
@ -29,6 +29,7 @@ import {
|
|||||||
AmountJson,
|
AmountJson,
|
||||||
AmountLike,
|
AmountLike,
|
||||||
Amounts,
|
Amounts,
|
||||||
|
AmountString,
|
||||||
ConfirmPayResult,
|
ConfirmPayResult,
|
||||||
ConfirmPayResultDone,
|
ConfirmPayResultDone,
|
||||||
ConfirmPayResultType,
|
ConfirmPayResultType,
|
||||||
@ -41,6 +42,7 @@ import {
|
|||||||
import { TalerError } from "@gnu-taler/taler-wallet-core";
|
import { TalerError } from "@gnu-taler/taler-wallet-core";
|
||||||
import { Fragment, h, VNode } from "preact";
|
import { Fragment, h, VNode } from "preact";
|
||||||
import { useEffect, useState } from "preact/hooks";
|
import { useEffect, useState } from "preact/hooks";
|
||||||
|
import { Amount } from "../components/Amount.js";
|
||||||
import { ErrorMessage } from "../components/ErrorMessage.js";
|
import { ErrorMessage } from "../components/ErrorMessage.js";
|
||||||
import { Loading } from "../components/Loading.js";
|
import { Loading } from "../components/Loading.js";
|
||||||
import { LoadingError } from "../components/LoadingError.js";
|
import { LoadingError } from "../components/LoadingError.js";
|
||||||
@ -261,7 +263,7 @@ export function PaymentRequestView({
|
|||||||
<section>
|
<section>
|
||||||
<ButtonSuccess upperCased onClick={onClick}>
|
<ButtonSuccess upperCased onClick={onClick}>
|
||||||
<i18n.Translate>
|
<i18n.Translate>
|
||||||
Pay {amountToString(payStatus.amountEffective)}
|
Pay {<Amount value={payStatus.amountEffective} />}
|
||||||
</i18n.Translate>
|
</i18n.Translate>
|
||||||
</ButtonSuccess>
|
</ButtonSuccess>
|
||||||
</section>
|
</section>
|
||||||
@ -276,8 +278,8 @@ export function PaymentRequestView({
|
|||||||
{balance ? (
|
{balance ? (
|
||||||
<WarningBox>
|
<WarningBox>
|
||||||
<i18n.Translate>
|
<i18n.Translate>
|
||||||
Your balance of {amountToString(balance)} is not enough to pay
|
Your balance of {<Amount value={balance} />} is not enough to
|
||||||
for this purchase
|
pay for this purchase
|
||||||
</i18n.Translate>
|
</i18n.Translate>
|
||||||
</WarningBox>
|
</WarningBox>
|
||||||
) : (
|
) : (
|
||||||
@ -374,14 +376,14 @@ export function PaymentRequestView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Total to pay</i18n.Translate>}
|
title={<i18n.Translate>Total to pay</i18n.Translate>}
|
||||||
text={amountToString(payStatus.amountEffective)}
|
text={<Amount value={payStatus.amountEffective} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Purchase amount</i18n.Translate>}
|
title={<i18n.Translate>Purchase amount</i18n.Translate>}
|
||||||
text={amountToString(payStatus.amountRaw)}
|
text={<Amount value={payStatus.amountRaw} />}
|
||||||
kind="neutral"
|
kind="neutral"
|
||||||
/>
|
/>
|
||||||
{Amounts.isNonZero(totalFees) && (
|
{Amounts.isNonZero(totalFees) && (
|
||||||
@ -389,7 +391,7 @@ export function PaymentRequestView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Fee</i18n.Translate>}
|
title={<i18n.Translate>Fee</i18n.Translate>}
|
||||||
text={amountToString(totalFees)}
|
text={<Amount value={totalFees} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@ -493,9 +495,3 @@ function ProductList({ products }: { products: Product[] }): VNode {
|
|||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function amountToString(text: AmountLike): string {
|
|
||||||
const aj = Amounts.jsonifyAmount(text);
|
|
||||||
const amount = Amounts.stringifyValue(aj, 2);
|
|
||||||
return `${amount} ${aj.currency}`;
|
|
||||||
}
|
|
||||||
|
@ -85,7 +85,7 @@ export function ManualWithdrawPage({ currency, onCancel }: Props): VNode {
|
|||||||
<ReserveCreated
|
<ReserveCreated
|
||||||
reservePub={success.response.reservePub}
|
reservePub={success.response.reservePub}
|
||||||
paytoURI={success.paytoURI}
|
paytoURI={success.paytoURI}
|
||||||
payto={success.payto}
|
// payto={success.payto}
|
||||||
exchangeBaseUrl={success.exchangeBaseUrl}
|
exchangeBaseUrl={success.exchangeBaseUrl}
|
||||||
amount={success.amount}
|
amount={success.amount}
|
||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
* @author Sebastian Javier Marchano (sebasjm)
|
* @author Sebastian Javier Marchano (sebasjm)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { parsePaytoUri } from "@gnu-taler/taler-util";
|
||||||
import { createExample } from "../test-utils.js";
|
import { createExample } from "../test-utils.js";
|
||||||
import { ReserveCreated as TestedComponent } from "./ReserveCreated.js";
|
import { ReserveCreated as TestedComponent } from "./ReserveCreated.js";
|
||||||
|
|
||||||
@ -30,8 +31,9 @@ export default {
|
|||||||
|
|
||||||
export const TalerBank = createExample(TestedComponent, {
|
export const TalerBank = createExample(TestedComponent, {
|
||||||
reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
|
reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
|
||||||
payto:
|
paytoURI: parsePaytoUri(
|
||||||
"payto://x-taler-bank/bank.taler:5882/exchangeminator?amount=COL%3A1&message=Taler+Withdrawal+A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
|
"payto://x-taler-bank/bank.taler:5882/exchangeminator?amount=COL%3A1&message=Taler+Withdrawal+A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
|
||||||
|
),
|
||||||
amount: {
|
amount: {
|
||||||
currency: "USD",
|
currency: "USD",
|
||||||
value: 10,
|
value: 10,
|
||||||
@ -42,8 +44,9 @@ export const TalerBank = createExample(TestedComponent, {
|
|||||||
|
|
||||||
export const IBAN = createExample(TestedComponent, {
|
export const IBAN = createExample(TestedComponent, {
|
||||||
reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
|
reservePub: "A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
|
||||||
payto:
|
paytoURI: parsePaytoUri(
|
||||||
"payto://iban/ASDQWEASDZXCASDQWE?amount=COL%3A1&message=Taler+Withdrawal+A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
|
"payto://iban/ASDQWEASDZXCASDQWE?amount=COL%3A1&message=Taler+Withdrawal+A05AJGMFNSK4Q62NXR2FKNDB1J4EXTYQTE7VA4M9GZQ4TR06YBNG",
|
||||||
|
),
|
||||||
amount: {
|
amount: {
|
||||||
currency: "USD",
|
currency: "USD",
|
||||||
value: 10,
|
value: 10,
|
||||||
@ -54,8 +57,9 @@ export const IBAN = createExample(TestedComponent, {
|
|||||||
|
|
||||||
export const Bitcoin = createExample(TestedComponent, {
|
export const Bitcoin = createExample(TestedComponent, {
|
||||||
reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
||||||
payto:
|
paytoURI: parsePaytoUri(
|
||||||
"payto://bitcoin/bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
"payto://bitcoin/bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
||||||
|
),
|
||||||
amount: {
|
amount: {
|
||||||
currency: "BTC",
|
currency: "BTC",
|
||||||
value: 0,
|
value: 0,
|
||||||
@ -66,8 +70,9 @@ export const Bitcoin = createExample(TestedComponent, {
|
|||||||
|
|
||||||
export const BitcoinRegTest = createExample(TestedComponent, {
|
export const BitcoinRegTest = createExample(TestedComponent, {
|
||||||
reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
||||||
payto:
|
paytoURI: parsePaytoUri(
|
||||||
"payto://bitcoin/bcrt1q6ps8qs6v8tkqrnru4xqqqa6rfwcx5ufpdfqht4?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
"payto://bitcoin/bcrt1q6ps8qs6v8tkqrnru4xqqqa6rfwcx5ufpdfqht4?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
||||||
|
),
|
||||||
amount: {
|
amount: {
|
||||||
currency: "BTC",
|
currency: "BTC",
|
||||||
value: 0,
|
value: 0,
|
||||||
@ -77,8 +82,9 @@ export const BitcoinRegTest = createExample(TestedComponent, {
|
|||||||
});
|
});
|
||||||
export const BitcoinTest = createExample(TestedComponent, {
|
export const BitcoinTest = createExample(TestedComponent, {
|
||||||
reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
reservePub: "0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
||||||
payto:
|
paytoURI: parsePaytoUri(
|
||||||
"payto://bitcoin/tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
"payto://bitcoin/tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx?amount=BTC:0.1&subject=0ZSX8SH0M30KHX8K3Y1DAMVGDQV82XEF9DG1HC4QMQ3QWYT4AF00",
|
||||||
|
),
|
||||||
amount: {
|
amount: {
|
||||||
currency: "BTC",
|
currency: "BTC",
|
||||||
value: 0,
|
value: 0,
|
||||||
|
@ -3,9 +3,12 @@ import {
|
|||||||
Amounts,
|
Amounts,
|
||||||
PaytoUri,
|
PaytoUri,
|
||||||
segwitMinAmount,
|
segwitMinAmount,
|
||||||
|
stringifyPaytoUri,
|
||||||
} from "@gnu-taler/taler-util";
|
} from "@gnu-taler/taler-util";
|
||||||
import { Fragment, h, VNode } from "preact";
|
import { Fragment, h, VNode } from "preact";
|
||||||
|
import { Amount } from "../components/Amount.js";
|
||||||
import { BankDetailsByPaytoType } from "../components/BankDetailsByPaytoType.js";
|
import { BankDetailsByPaytoType } from "../components/BankDetailsByPaytoType.js";
|
||||||
|
import { ErrorMessage } from "../components/ErrorMessage.js";
|
||||||
import { QR } from "../components/QR.js";
|
import { QR } from "../components/QR.js";
|
||||||
import {
|
import {
|
||||||
ButtonDestructive,
|
ButtonDestructive,
|
||||||
@ -13,11 +16,9 @@ import {
|
|||||||
WarningBox,
|
WarningBox,
|
||||||
} from "../components/styled/index.js";
|
} from "../components/styled/index.js";
|
||||||
import { useTranslationContext } from "../context/translation.js";
|
import { useTranslationContext } from "../context/translation.js";
|
||||||
import { amountToString } from "../utils/index.js";
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
reservePub: string;
|
reservePub: string;
|
||||||
paytoURI: PaytoUri | undefined;
|
paytoURI: PaytoUri | undefined;
|
||||||
payto: string;
|
|
||||||
exchangeBaseUrl: string;
|
exchangeBaseUrl: string;
|
||||||
amount: AmountJson;
|
amount: AmountJson;
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
@ -26,7 +27,6 @@ export interface Props {
|
|||||||
export function ReserveCreated({
|
export function ReserveCreated({
|
||||||
reservePub,
|
reservePub,
|
||||||
paytoURI,
|
paytoURI,
|
||||||
payto,
|
|
||||||
onCancel,
|
onCancel,
|
||||||
exchangeBaseUrl,
|
exchangeBaseUrl,
|
||||||
amount,
|
amount,
|
||||||
@ -34,11 +34,10 @@ export function ReserveCreated({
|
|||||||
const { i18n } = useTranslationContext();
|
const { i18n } = useTranslationContext();
|
||||||
if (!paytoURI) {
|
if (!paytoURI) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<ErrorMessage
|
||||||
<i18n.Translate>
|
title={<i18n.Translate>Could not parse the payto URI</i18n.Translate>}
|
||||||
could not parse payto uri from exchange {payto}
|
description={<i18n.Translate>Please check the uri</i18n.Translate>}
|
||||||
</i18n.Translate>
|
/>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function TransferDetails(): VNode {
|
function TransferDetails(): VNode {
|
||||||
@ -97,7 +96,7 @@ export function ReserveCreated({
|
|||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<BankDetailsByPaytoType
|
<BankDetailsByPaytoType
|
||||||
amount={amountToString(amount)}
|
amount={<Amount value={amount} />}
|
||||||
exchangeBaseUrl={exchangeBaseUrl}
|
exchangeBaseUrl={exchangeBaseUrl}
|
||||||
payto={paytoURI}
|
payto={paytoURI}
|
||||||
subject={reservePub}
|
subject={reservePub}
|
||||||
@ -123,7 +122,7 @@ export function ReserveCreated({
|
|||||||
<p>
|
<p>
|
||||||
<i18n.Translate>
|
<i18n.Translate>
|
||||||
To complete the process you need to wire{` `}
|
To complete the process you need to wire{` `}
|
||||||
<b>{amountToString(amount)}</b> to the exchange bank account
|
<b>{<Amount value={amount} />}</b> to the exchange bank account
|
||||||
</i18n.Translate>
|
</i18n.Translate>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
@ -132,11 +131,11 @@ export function ReserveCreated({
|
|||||||
<p>
|
<p>
|
||||||
<i18n.Translate>
|
<i18n.Translate>
|
||||||
Alternative, you can also scan this QR code or open{" "}
|
Alternative, you can also scan this QR code or open{" "}
|
||||||
<a href={payto}>this link</a> if you have a banking app installed
|
<a href={stringifyPaytoUri(paytoURI)}>this link</a> if you have a
|
||||||
that supports RFC 8905
|
banking app installed that supports RFC 8905
|
||||||
</i18n.Translate>
|
</i18n.Translate>
|
||||||
</p>
|
</p>
|
||||||
<QR text={payto} />
|
<QR text={stringifyPaytoUri(paytoURI)} />
|
||||||
</section>
|
</section>
|
||||||
<footer>
|
<footer>
|
||||||
<div />
|
<div />
|
||||||
|
@ -28,6 +28,7 @@ import { differenceInSeconds } from "date-fns";
|
|||||||
import { ComponentChildren, Fragment, h, VNode } from "preact";
|
import { ComponentChildren, Fragment, h, VNode } from "preact";
|
||||||
import { useState } from "preact/hooks";
|
import { useState } from "preact/hooks";
|
||||||
import emptyImg from "../../static/img/empty.png";
|
import emptyImg from "../../static/img/empty.png";
|
||||||
|
import { Amount } from "../components/Amount.js";
|
||||||
import { BankDetailsByPaytoType } from "../components/BankDetailsByPaytoType.js";
|
import { BankDetailsByPaytoType } from "../components/BankDetailsByPaytoType.js";
|
||||||
import { ErrorTalerOperation } from "../components/ErrorTalerOperation.js";
|
import { ErrorTalerOperation } from "../components/ErrorTalerOperation.js";
|
||||||
import { Loading } from "../components/Loading.js";
|
import { Loading } from "../components/Loading.js";
|
||||||
@ -180,12 +181,6 @@ export function TransactionView({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function amountToString(text: AmountLike): string {
|
|
||||||
const aj = Amounts.jsonifyAmount(text);
|
|
||||||
const amount = Amounts.stringifyValue(aj);
|
|
||||||
return `${amount} ${aj.currency}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (transaction.type === TransactionType.Withdrawal) {
|
if (transaction.type === TransactionType.Withdrawal) {
|
||||||
const fee = Amounts.sub(
|
const fee = Amounts.sub(
|
||||||
Amounts.parseOrThrow(transaction.amountRaw),
|
Amounts.parseOrThrow(transaction.amountRaw),
|
||||||
@ -229,7 +224,7 @@ export function TransactionView({
|
|||||||
WithdrawalType.ManualTransfer ? (
|
WithdrawalType.ManualTransfer ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<BankDetailsByPaytoType
|
<BankDetailsByPaytoType
|
||||||
amount={amountToString(transaction.amountRaw)}
|
amount={<Amount value={transaction.amountRaw} />}
|
||||||
exchangeBaseUrl={transaction.exchangeBaseUrl}
|
exchangeBaseUrl={transaction.exchangeBaseUrl}
|
||||||
payto={parsePaytoUri(
|
payto={parsePaytoUri(
|
||||||
transaction.withdrawalDetails.exchangePaytoUris[0],
|
transaction.withdrawalDetails.exchangePaytoUris[0],
|
||||||
@ -247,13 +242,13 @@ export function TransactionView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Total withdrawn</i18n.Translate>}
|
title={<i18n.Translate>Total withdrawn</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountEffective)}
|
text={<Amount value={transaction.amountEffective} />}
|
||||||
kind="positive"
|
kind="positive"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Exchange fee</i18n.Translate>}
|
title={<i18n.Translate>Exchange fee</i18n.Translate>}
|
||||||
text={amountToString(fee)}
|
text={<Amount value={fee} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@ -284,19 +279,19 @@ export function TransactionView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Total withdrawn</i18n.Translate>}
|
title={<i18n.Translate>Total withdrawn</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountEffective)}
|
text={<Amount value={transaction.amountEffective} />}
|
||||||
kind="positive"
|
kind="positive"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Chosen amount</i18n.Translate>}
|
title={<i18n.Translate>Chosen amount</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountRaw)}
|
text={<Amount value={transaction.amountRaw} />}
|
||||||
kind="neutral"
|
kind="neutral"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Exchange fee</i18n.Translate>}
|
title={<i18n.Translate>Exchange fee</i18n.Translate>}
|
||||||
text={amountToString(fee)}
|
text={<Amount value={fee} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@ -306,19 +301,19 @@ export function TransactionView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Total withdrawn</i18n.Translate>}
|
title={<i18n.Translate>Total withdrawn</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountEffective)}
|
text={<Amount value={transaction.amountEffective} />}
|
||||||
kind="positive"
|
kind="positive"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Chosen amount</i18n.Translate>}
|
title={<i18n.Translate>Chosen amount</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountRaw)}
|
text={<Amount value={transaction.amountRaw} />}
|
||||||
kind="neutral"
|
kind="neutral"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Exchange fee</i18n.Translate>}
|
title={<i18n.Translate>Exchange fee</i18n.Translate>}
|
||||||
text={amountToString(fee)}
|
text={<Amount value={fee} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@ -355,19 +350,19 @@ export function TransactionView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Total paid</i18n.Translate>}
|
title={<i18n.Translate>Total paid</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountEffective)}
|
text={<Amount value={transaction.amountEffective} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Purchase amount</i18n.Translate>}
|
title={<i18n.Translate>Purchase amount</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountRaw)}
|
text={<Amount value={transaction.amountRaw} />}
|
||||||
kind="neutral"
|
kind="neutral"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Fee</i18n.Translate>}
|
title={<i18n.Translate>Fee</i18n.Translate>}
|
||||||
text={amountToString(fee)}
|
text={<Amount value={fee} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
@ -441,19 +436,19 @@ export function TransactionView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Total send</i18n.Translate>}
|
title={<i18n.Translate>Total send</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountEffective)}
|
text={<Amount value={transaction.amountEffective} />}
|
||||||
kind="neutral"
|
kind="neutral"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Deposit amount</i18n.Translate>}
|
title={<i18n.Translate>Deposit amount</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountRaw)}
|
text={<Amount value={transaction.amountRaw} />}
|
||||||
kind="positive"
|
kind="positive"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Fee</i18n.Translate>}
|
title={<i18n.Translate>Fee</i18n.Translate>}
|
||||||
text={amountToString(fee)}
|
text={<Amount value={fee} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
</TransactionTemplate>
|
</TransactionTemplate>
|
||||||
@ -478,19 +473,19 @@ export function TransactionView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Total refresh</i18n.Translate>}
|
title={<i18n.Translate>Total refresh</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountEffective)}
|
text={<Amount value={transaction.amountEffective} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Refresh amount</i18n.Translate>}
|
title={<i18n.Translate>Refresh amount</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountRaw)}
|
text={<Amount value={transaction.amountRaw} />}
|
||||||
kind="neutral"
|
kind="neutral"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Fee</i18n.Translate>}
|
title={<i18n.Translate>Fee</i18n.Translate>}
|
||||||
text={amountToString(fee)}
|
text={<Amount value={fee} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
</TransactionTemplate>
|
</TransactionTemplate>
|
||||||
@ -515,19 +510,19 @@ export function TransactionView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Total tip</i18n.Translate>}
|
title={<i18n.Translate>Total tip</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountEffective)}
|
text={<Amount value={transaction.amountEffective} />}
|
||||||
kind="positive"
|
kind="positive"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Received amount</i18n.Translate>}
|
title={<i18n.Translate>Received amount</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountRaw)}
|
text={<Amount value={transaction.amountRaw} />}
|
||||||
kind="neutral"
|
kind="neutral"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Fee</i18n.Translate>}
|
title={<i18n.Translate>Fee</i18n.Translate>}
|
||||||
text={amountToString(fee)}
|
text={<Amount value={fee} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
</TransactionTemplate>
|
</TransactionTemplate>
|
||||||
@ -552,19 +547,19 @@ export function TransactionView({
|
|||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Total refund</i18n.Translate>}
|
title={<i18n.Translate>Total refund</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountEffective)}
|
text={<Amount value={transaction.amountEffective} />}
|
||||||
kind="positive"
|
kind="positive"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Refund amount</i18n.Translate>}
|
title={<i18n.Translate>Refund amount</i18n.Translate>}
|
||||||
text={amountToString(transaction.amountRaw)}
|
text={<Amount value={transaction.amountRaw} />}
|
||||||
kind="neutral"
|
kind="neutral"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
big
|
big
|
||||||
title={<i18n.Translate>Fee</i18n.Translate>}
|
title={<i18n.Translate>Fee</i18n.Translate>}
|
||||||
text={amountToString(fee)}
|
text={<Amount value={fee} />}
|
||||||
kind="negative"
|
kind="negative"
|
||||||
/>
|
/>
|
||||||
<Part
|
<Part
|
||||||
|
Loading…
Reference in New Issue
Block a user