From e19d708be202603fd7f4a103b17b425ef61e18db Mon Sep 17 00:00:00 2001 From: Ahamed Faizal Date: Mon, 4 Dec 2023 09:43:44 +0800 Subject: [PATCH 1/2] fix/AELF_24359589: Round of amount in all transaction list --- components/transactions/components/AllTransactions.tsx | 4 ++++ utils/index.ts | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/components/transactions/components/AllTransactions.tsx b/components/transactions/components/AllTransactions.tsx index f35d0d5..3c80a15 100644 --- a/components/transactions/components/AllTransactions.tsx +++ b/components/transactions/components/AllTransactions.tsx @@ -12,6 +12,7 @@ import { addressState } from "@/state"; import PaperLayout from '@/components/common/paperLayout' import CopyToClipboard from '@/components/common/copyToClipboard' import {MIN_TRANSACTIONS_TO_SHOW_EXPLORER_LINK} from '@/utils/constants'; +import {roundNumber} from '@/utils'; import rightArrowImage from '@/assets/icon/right-arrow.svg'; import rightArrowSuccessImage from '@/assets/icon/right-arrow-success.svg'; import { List } from "../../../app/transactions/route"; @@ -127,6 +128,9 @@ const AllTransactions = () => { title: "Amount", dataIndex: "amount", key: "amount", + render: (val) => ( + roundNumber(val) + ), }, ]; diff --git a/utils/index.ts b/utils/index.ts index b2329db..0d24f59 100644 --- a/utils/index.ts +++ b/utils/index.ts @@ -23,4 +23,10 @@ export const formatNumber = (value: string) => { export const isEmptyObject = (obj: object) => { return Object.keys(obj).length === 0; +} + +export const roundNumber = (num: string) => { + const trimmed = parseFloat(num).toString(); + const formatted = trimmed.replace(/(\.\d*?[1-9])0+$/g, '$1'); + return formatted; } \ No newline at end of file From e1817fda5f1549a411856e71dfa9ce185621b414 Mon Sep 17 00:00:00 2001 From: Ahamed Faizal Date: Mon, 4 Dec 2023 09:53:58 +0800 Subject: [PATCH 2/2] fix/AELF_24359589: Disable close popup --- components/transactions/components/SendTransaction.tsx | 2 ++ components/transactions/components/TransferVerification.tsx | 1 + 2 files changed, 3 insertions(+) diff --git a/components/transactions/components/SendTransaction.tsx b/components/transactions/components/SendTransaction.tsx index 2909212..074ba3e 100644 --- a/components/transactions/components/SendTransaction.tsx +++ b/components/transactions/components/SendTransaction.tsx @@ -318,6 +318,7 @@ function SendTransaction({ onCancel={onClose} open={showSuccessModal} centered width={442} + maskClosable={false} footer={() => }> }> (