diff --git a/packages/huma-widget/src/components/CreditLine/borrow/5-Success.tsx b/packages/huma-widget/src/components/CreditLine/borrow/5-Success.tsx index b997542..9421285 100644 --- a/packages/huma-widget/src/components/CreditLine/borrow/5-Success.tsx +++ b/packages/huma-widget/src/components/CreditLine/borrow/5-Success.tsx @@ -1,4 +1,9 @@ -import { CreditRecordType, PoolInfoType, timeUtil } from '@huma-finance/shared' +import { + CreditRecordType, + PoolInfoType, + formatNumber, + timeUtil, +} from '@huma-finance/shared' import React from 'react' import { useAppSelector } from '../../../hooks/useRedux' @@ -24,7 +29,7 @@ export function Success({ const dueDate = timeUtil.timestampToLL(creditRecord?.dueDate.toNumber()) const content = [ - `${borrowAmountNet} ${symbol} is now in your wallet.`, + `${formatNumber(borrowAmountNet)} ${symbol} is now in your wallet.`, `Note: your payment will be automatically deducted on ${dueDate}.`, ] diff --git a/packages/huma-widget/src/components/CreditLine/borrowV2/4-Success.tsx b/packages/huma-widget/src/components/CreditLine/borrowV2/4-Success.tsx index 8e1b8b5..4bba3af 100644 --- a/packages/huma-widget/src/components/CreditLine/borrowV2/4-Success.tsx +++ b/packages/huma-widget/src/components/CreditLine/borrowV2/4-Success.tsx @@ -1,5 +1,6 @@ import { CreditStatsV2, + formatNumber, timeUtil, UnderlyingTokenInfo, } from '@huma-finance/shared' @@ -27,7 +28,7 @@ export function Success({ const dueDate = timeUtil.timestampToLL(creditRecord?.nextDueDate.toNumber()) const content = [ - `${borrowAmountNet} ${symbol} is now in your wallet.`, + `${formatNumber(borrowAmountNet)} ${symbol} is now in your wallet.`, `Note: your payment will be automatically deducted on ${dueDate}.`, ] diff --git a/packages/huma-widget/src/components/CreditLine/payment/4-Success.tsx b/packages/huma-widget/src/components/CreditLine/payment/4-Success.tsx index bd262cd..5fddc8e 100644 --- a/packages/huma-widget/src/components/CreditLine/payment/4-Success.tsx +++ b/packages/huma-widget/src/components/CreditLine/payment/4-Success.tsx @@ -1,7 +1,7 @@ import { decodeLogs, downScale, - formatMoney, + formatNumber, PoolInfoType, sendTxAtom, TRANSFER_ABI, @@ -32,7 +32,7 @@ export function Success({ poolInfo, handleAction }: Props): React.ReactElement { }, [decimals, txReceipt]) const content = [ - `You successfully paid ${formatMoney(payedAmount)} ${symbol}.`, + `You successfully paid ${formatNumber(payedAmount)} ${symbol}.`, ] return diff --git a/packages/huma-widget/src/components/CreditLine/paymentV2/4-Success.tsx b/packages/huma-widget/src/components/CreditLine/paymentV2/4-Success.tsx index 944a0be..3d8deaa 100644 --- a/packages/huma-widget/src/components/CreditLine/paymentV2/4-Success.tsx +++ b/packages/huma-widget/src/components/CreditLine/paymentV2/4-Success.tsx @@ -1,7 +1,7 @@ import { decodeLogs, downScale, - formatMoney, + formatNumber, sendTxAtom, TRANSFER_ABI, UnderlyingTokenInfo, @@ -35,7 +35,7 @@ export function Success({ }, [decimals, txReceipt]) const content = [ - `You successfully paid ${formatMoney(paidAmount)} ${symbol}.`, + `You successfully paid ${formatNumber(paidAmount)} ${symbol}.`, ] return diff --git a/packages/huma-widget/src/components/InvoiceFactoring/borrow/6-Success.tsx b/packages/huma-widget/src/components/InvoiceFactoring/borrow/6-Success.tsx index a28de4d..fa71abf 100644 --- a/packages/huma-widget/src/components/InvoiceFactoring/borrow/6-Success.tsx +++ b/packages/huma-widget/src/components/InvoiceFactoring/borrow/6-Success.tsx @@ -1,4 +1,6 @@ +import { formatNumber } from '@huma-finance/shared' import React from 'react' + import { useAppSelector } from '../../../hooks/useRedux' import { selectWidgetState } from '../../../store/widgets.selectors' import { TxDoneModal } from '../../TxDoneModal' @@ -12,7 +14,9 @@ export function Success({ handleAction }: Props): React.ReactElement { useAppSelector(selectWidgetState) const content = [ - `${borrowAmountNet} ${approval?.token.symbol} is now in your wallet.`, + `${formatNumber(borrowAmountNet)} ${ + approval?.token.symbol + } is now in your wallet.`, `The remaining ${remainder} ${approval?.token.symbol} will be sent to your wallet when the invoice is paid.`, ] diff --git a/packages/huma-widget/src/components/ReceivableBackedCreditLine/borrow/5-Success.tsx b/packages/huma-widget/src/components/ReceivableBackedCreditLine/borrow/5-Success.tsx index 8e1b8b5..4bba3af 100644 --- a/packages/huma-widget/src/components/ReceivableBackedCreditLine/borrow/5-Success.tsx +++ b/packages/huma-widget/src/components/ReceivableBackedCreditLine/borrow/5-Success.tsx @@ -1,5 +1,6 @@ import { CreditStatsV2, + formatNumber, timeUtil, UnderlyingTokenInfo, } from '@huma-finance/shared' @@ -27,7 +28,7 @@ export function Success({ const dueDate = timeUtil.timestampToLL(creditRecord?.nextDueDate.toNumber()) const content = [ - `${borrowAmountNet} ${symbol} is now in your wallet.`, + `${formatNumber(borrowAmountNet)} ${symbol} is now in your wallet.`, `Note: your payment will be automatically deducted on ${dueDate}.`, ] diff --git a/packages/huma-widget/src/components/ReceivableBackedCreditLine/payment/7-Success.tsx b/packages/huma-widget/src/components/ReceivableBackedCreditLine/payment/7-Success.tsx index e75eab3..857258b 100644 --- a/packages/huma-widget/src/components/ReceivableBackedCreditLine/payment/7-Success.tsx +++ b/packages/huma-widget/src/components/ReceivableBackedCreditLine/payment/7-Success.tsx @@ -1,7 +1,7 @@ import { decodeLogs, downScale, - formatMoney, + formatNumber, TRANSFER_ABI, UnderlyingTokenInfo, } from '@huma-finance/shared' @@ -37,12 +37,12 @@ export function Success({ } }, [decimals, successTxReceipt]) - const amoutFormatted = formatMoney(paidAmount) + const amountFormatted = formatNumber(paidAmount) const content = paymentType === PaymentType.PaymentWithReceivable - ? [`You successfully paid ${amoutFormatted} ${symbol}.`] + ? [`You successfully paid ${amountFormatted} ${symbol}.`] : [ - `You successfully paid ${amoutFormatted} ${symbol} and borrowed ${amoutFormatted} ${symbol}.`, + `You successfully paid ${amountFormatted} ${symbol} and borrowed ${amountFormatted} ${symbol}.`, ] return diff --git a/packages/huma-widget/src/components/StreamFactoring/borrow/7-Success.tsx b/packages/huma-widget/src/components/StreamFactoring/borrow/7-Success.tsx index d314875..570b286 100644 --- a/packages/huma-widget/src/components/StreamFactoring/borrow/7-Success.tsx +++ b/packages/huma-widget/src/components/StreamFactoring/borrow/7-Success.tsx @@ -1,4 +1,6 @@ +import { formatNumber } from '@huma-finance/shared' import React from 'react' + import { useAppSelector } from '../../../hooks/useRedux' import { selectWidgetState } from '../../../store/widgets.selectors' import { TxDoneModal } from '../../TxDoneModal' @@ -11,7 +13,7 @@ export function Success({ handleAction }: Props): React.ReactElement { const { borrowAmount, approval } = useAppSelector(selectWidgetState) const content = [ - `${borrowAmount?.toFixed(2)} ${ + `${formatNumber(borrowAmount)} ${ approval?.token.symbol } is now in your wallet.`, ]