Skip to content

Commit

Permalink
Merge pull request #12 from yongenaelf/fix/AELF_24359589
Browse files Browse the repository at this point in the history
fix/AELF_24359589, fix/AELF_ 24659121: Disable close of modal popup on clicking outside and round off amount field in transaction list.
  • Loading branch information
Faizal-aelf authored Dec 4, 2023
2 parents fa79146 + e1817fd commit 173f0d7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/transactions/components/AllTransactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -127,6 +128,9 @@ const AllTransactions = () => {
title: "Amount",
dataIndex: "amount",
key: "amount",
render: (val) => (
roundNumber(val)
),
},
];

Expand Down
2 changes: 2 additions & 0 deletions components/transactions/components/SendTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ function SendTransaction({
onCancel={onClose}
open={showSuccessModal}
centered width={442}
maskClosable={false}
footer={() => <Button type="primary" onClick={onClose} block>Close</Button>}>
<Result
status="success"
Expand All @@ -329,6 +330,7 @@ function SendTransaction({
onCancel={onClose}
open={showFailureModal}
centered width={442}
maskClosable={false}
footer={() => <Button type="primary" onClick={onClose} block>Close</Button>}>
<Result
status="error"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const TransferVerification = ({
closable
onCancel={onCancel}
title='Transaction Summary'
maskClosable={false}
centered
width={672}
footer={() => (<Flex flex={1} gap={12}>
Expand Down
6 changes: 6 additions & 0 deletions utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 173f0d7

Please sign in to comment.