From 0bfe3fc8facc470f8297bd9465906de7e3e262cc Mon Sep 17 00:00:00 2001 From: CloudCludfore Date: Thu, 20 Jun 2024 10:01:01 +0700 Subject: [PATCH] fix bug build --- src/app/get-aura/table.tsx | 47 +++++++++++++++----------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/src/app/get-aura/table.tsx b/src/app/get-aura/table.tsx index 4d6c2be..17a7472 100644 --- a/src/app/get-aura/table.tsx +++ b/src/app/get-aura/table.tsx @@ -19,28 +19,23 @@ export default function TableHistory() { // const test = "0x7c698F755Cf38b71dEef73B77E0F1438EecA99F2"; const isMobile = useMediaQuery({ maxWidth: 600 }); - const [activityHistories, setActivityHistories] = useState( - [] - ); - useEffect(() => { - useActivityHistory(account?.address?.toLowerCase() || "").then((res) => { - if (res?.length > 0) { - const mappedList = res?.map((item) => { - const status = - item?.status === "completed" ? "success" : item?.status; - return { - txTime: item.created_at, - evmTxHash: item.incoming_tx_hash, - cosmosTxHash: item.outgoing_tx_hash, - depAddress: item.cex_address, - amount: Number(item.amount), - status: status?.charAt(0).toUpperCase() + status?.slice(1), - }; - }); - setActivityHistories(mappedList); - } - }); - }, []); + const [activityHistories, setActivityHistories] = useState([]); + useActivityHistory(account?.address?.toLowerCase() || "").then((res) => { + if (res?.length > 0) { + const mappedList = res?.map((item) => { + const status = item?.status === "completed" ? "success" : item?.status; + return { + txTime: item.created_at, + evmTxHash: item.incoming_tx_hash, + cosmosTxHash: item.outgoing_tx_hash, + depAddress: item.cex_address, + amount: Number(item.amount), + status: status?.charAt(0).toUpperCase() + status?.slice(1), + }; + }); + setActivityHistories(mappedList); + } + }); if (isMobile) { return ( @@ -49,7 +44,7 @@ export default function TableHistory() { {activityHistories?.length > 0 ? ( activityHistories?.map((item) => ( -
+
)) @@ -84,11 +79,7 @@ export default function TableHistory() {
Status
- {activityHistories?.length > 0 ? ( - activityHistories?.map((item) => ) - ) : ( -
No history yet
- )} + {activityHistories?.length > 0 ? activityHistories?.map((item) => ) :
No history yet
} );