From 69f63c2bbc6fc7e3651d0f59eee2768a2e62479e Mon Sep 17 00:00:00 2001 From: isstuev Date: Fri, 19 Jan 2024 11:02:08 +0100 Subject: [PATCH] fixes --- icons/user_op.svg | 6 +----- ui/pages/UserOp.tsx | 15 +++++++++------ ui/userOp/UserOpDetails.tsx | 6 +++--- ui/userOps/UserOpsContent.tsx | 4 ++-- ui/userOps/UserOpsTable.tsx | 20 +++++++++++--------- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/icons/user_op.svg b/icons/user_op.svg index f92a33ebbf..45f3f6d211 100644 --- a/icons/user_op.svg +++ b/icons/user_op.svg @@ -1,8 +1,4 @@ - - - - - + diff --git a/ui/pages/UserOp.tsx b/ui/pages/UserOp.tsx index 9adda75f4e..af6bd464f7 100644 --- a/ui/pages/UserOp.tsx +++ b/ui/pages/UserOp.tsx @@ -22,7 +22,7 @@ import UserOpCallData from 'ui/userOp/UserOpCallData'; import UserOpDetails from 'ui/userOp/UserOpDetails'; import UserOpRaw from 'ui/userOp/UserOpRaw'; -const BlockPageContent = () => { +const UserOp = () => { const router = useRouter(); const appProps = useAppContext(); const hash = getQueryParamString(router.query.hash); @@ -35,27 +35,30 @@ const BlockPageContent = () => { }, }); + const logRangeStart = Number(userOpQuery.data?.user_logs_start_index); + const logRangeEnd = logRangeStart + Number(userOpQuery.data?.user_logs_count); + const filterTokenTransfersByLogIndex = React.useCallback((tt: TokenTransfer) => { if (!userOpQuery.data) { return true; } else { - if (inRange(Number(tt.log_index), userOpQuery.data.user_logs_start_index, userOpQuery.data.user_logs_start_index + userOpQuery.data.user_logs_count)) { + if (inRange(Number(tt.log_index), logRangeStart, logRangeEnd)) { return true; } return false; } - }, [ userOpQuery.data ]); + }, [ userOpQuery.data, logRangeStart, logRangeEnd ]); const filterLogsByLogIndex = React.useCallback((log: Log) => { if (!userOpQuery.data) { return true; } else { - if (inRange(log.index, userOpQuery.data.user_logs_start_index, userOpQuery.data.user_logs_start_index + userOpQuery.data.user_logs_count)) { + if (inRange(log.index, logRangeStart, logRangeEnd)) { return true; } return false; } - }, [ userOpQuery.data ]); + }, [ userOpQuery.data, logRangeStart, logRangeEnd ]); const tabs: Array = React.useMemo(() => ([ { id: 'index', title: 'Details', component: }, @@ -117,4 +120,4 @@ const BlockPageContent = () => { ); }; -export default BlockPageContent; +export default UserOp; diff --git a/ui/userOp/UserOpDetails.tsx b/ui/userOp/UserOpDetails.tsx index fb1c17d8f6..c8fa9f89d8 100644 --- a/ui/userOp/UserOpDetails.tsx +++ b/ui/userOp/UserOpDetails.tsx @@ -17,7 +17,7 @@ import DetailsInfoItemDivider from 'ui/shared/DetailsInfoItemDivider'; import DetailsTimestamp from 'ui/shared/DetailsTimestamp'; import BlockEntity from 'ui/shared/entities/block/BlockEntity'; import TxEntity from 'ui/shared/entities/tx/TxEntity'; -import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic'; +import UserOpEntity from 'ui/shared/entities/userOp/UserOpEntity'; import UserOpsAddress from 'ui/shared/userOps/UserOpsAddress'; import UserOpSponsorType from 'ui/shared/userOps/UserOpSponsorType'; import UserOpStatus from 'ui/shared/userOps/UserOpStatus'; @@ -71,7 +71,7 @@ const UserOpDetails = ({ query }: Props) => { isLoading={ isPlaceholderData } > - + { title="Transaction hash" hint="Hash of the transaction this User operation belongs to" > - + { /> - { query.data.items.map(((item, index) => ( + { query.data.items.map((item, index) => ( { showTx={ showTx } showSender={ showSender } /> - ))) } + )) } ) : null; diff --git a/ui/userOps/UserOpsTable.tsx b/ui/userOps/UserOpsTable.tsx index dbcc9e2246..0478a283e4 100644 --- a/ui/userOps/UserOpsTable.tsx +++ b/ui/userOps/UserOpsTable.tsx @@ -31,15 +31,17 @@ const UserOpsTable = ({ items, isLoading, top, showTx, showSender }: Props) => { - { items.map((item, index) => ( - - )) } + { items.map((item, index) => { + return ( + + ); + }) } );