diff options
author | Sebastian <sebasjm@gmail.com> | 2024-02-06 17:06:56 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-02-06 17:06:56 -0300 |
commit | 27e4ff3011527d9c0b7630dc7a4080f8fb817300 (patch) | |
tree | a56f906cc36065eaf1733ea97a4eccc690145094 /packages/taler-wallet-webextension/src/wallet/Transaction.tsx | |
parent | f91319e404ecfebfbc343175dd0bb73ab10eb4c0 (diff) | |
download | wallet-core-27e4ff3011527d9c0b7630dc7a4080f8fb817300.tar.xz |
fixes #8336 remove rewards
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/Transaction.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Transaction.tsx | 92 |
1 files changed, 10 insertions, 82 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index f6c98952e..65fc90f44 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -229,8 +229,8 @@ function TransactionTemplate({ <Fragment> <section style={{ padding: 8, textAlign: "center" }}> {transaction?.error && - // FIXME: wallet core should stop sending this error on KYC - transaction.error.code !== + // FIXME: wallet core should stop sending this error on KYC + transaction.error.code !== TalerErrorCode.WALLET_WITHDRAWAL_KYC_REQUIRED ? ( <ErrorAlertView error={alertFromError( @@ -465,11 +465,11 @@ export function TransactionView({ </Header> {transaction.txState.major !== - TransactionMajorState.Pending ? undefined : transaction.txState + TransactionMajorState.Pending ? undefined : transaction.txState .minor === TransactionMinorState.KycRequired || - transaction.txState.minor === + transaction.txState.minor === TransactionMinorState.AmlRequired ? undefined : transaction - .withdrawalDetails.type === WithdrawalType.ManualTransfer ? ( + .withdrawalDetails.type === WithdrawalType.ManualTransfer ? ( //manual withdrawal <BankDetailsByPaytoType amount={raw} @@ -751,40 +751,6 @@ export function TransactionView({ ); } - if (transaction.type === TransactionType.Reward) { - return ( - <TransactionTemplate - transaction={transaction} - onDelete={onDelete} - onRetry={onRetry} - onAbort={onAbort} - onResume={onResume} - onSuspend={onSuspend} - onCancel={onCancel} - > - <Header - timestamp={transaction.timestamp} - type={i18n.str`Tip`} - total={effective} - kind="positive" - > - {transaction.merchantBaseUrl} - </Header> - {/* <Part - title={i18n.str`Merchant`} - text={<MerchantDetails merchant={transaction.merchant} />} - kind="neutral" - /> */} - <Part - title={i18n.str`Details`} - text={ - <TipDetails amount={getAmountWithFee(effective, raw, "credit")} /> - } - /> - </TransactionTemplate> - ); - } - if (transaction.type === TransactionType.Refund) { return ( <TransactionTemplate @@ -1042,6 +1008,9 @@ export function TransactionView({ if (transaction.type === TransactionType.Recoup) { throw Error("recoup transaction not implemented"); } + if (transaction.type === TransactionType.Reward) { + throw Error("recoup transaction not implemented"); + } assertUnreachable(transaction); } @@ -1453,7 +1422,7 @@ export function WithdrawDetails({ </td> </tr> {conversion.fraction === amount.value.fraction && - conversion.value === amount.value.value ? undefined : ( + conversion.value === amount.value.value ? undefined : ( <tr> <td> <i18n.Translate>Converted</i18n.Translate> @@ -1839,47 +1808,6 @@ function RefreshDetails({ amount }: { amount: AmountWithFee }): VNode { ); } -function TipDetails({ amount }: { amount: AmountWithFee }): VNode { - const { i18n } = useTranslationContext(); - - return ( - <PurchaseDetailsTable> - <tr> - <td> - <i18n.Translate>Tip</i18n.Translate> - </td> - <td> - <Amount value={amount.value} maxFracSize={amount.maxFrac} /> - </td> - </tr> - - {Amounts.isNonZero(amount.fee) && ( - <tr> - <td> - <i18n.Translate>Fees</i18n.Translate> - </td> - <td> - <Amount value={amount.fee} maxFracSize={amount.maxFrac} /> - </td> - </tr> - )} - <tr> - <td colSpan={2}> - <hr /> - </td> - </tr> - <tr> - <td> - <i18n.Translate>Total</i18n.Translate> - </td> - <td> - <Amount value={amount.total} maxFracSize={amount.maxFrac} /> - </td> - </tr> - </PurchaseDetailsTable> - ); -} - function Header({ timestamp, total, @@ -2054,7 +1982,7 @@ function ShowWithdrawalDetailForBankIntegrated({ /> )} {!transaction.withdrawalDetails.confirmed && - transaction.withdrawalDetails.bankConfirmationUrl ? ( + transaction.withdrawalDetails.bankConfirmationUrl ? ( <InfoBox> <div style={{ display: "block" }}> <i18n.Translate> |