Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminaAiren committed Jan 19, 2024
1 parent 8c0967a commit 69f63c2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
6 changes: 1 addition & 5 deletions icons/user_op.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 9 additions & 6 deletions ui/pages/UserOp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<RoutedTab> = React.useMemo(() => ([
{ id: 'index', title: 'Details', component: <UserOpDetails query={ userOpQuery }/> },
Expand Down Expand Up @@ -117,4 +120,4 @@ const BlockPageContent = () => {
);
};

export default BlockPageContent;
export default UserOp;
6 changes: 3 additions & 3 deletions ui/userOp/UserOpDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -71,7 +71,7 @@ const UserOpDetails = ({ query }: Props) => {
isLoading={ isPlaceholderData }
>
<Skeleton isLoaded={ !isPlaceholderData } overflow="hidden">
<HashStringShortenDynamic hash={ data.hash }/>
<UserOpEntity hash={ data.hash } noIcon noLink/>
</Skeleton>
</DetailsInfoItem>
<DetailsInfoItem
Expand Down Expand Up @@ -138,7 +138,7 @@ const UserOpDetails = ({ query }: Props) => {
title="Transaction hash"
hint="Hash of the transaction this User operation belongs to"
>
<TxEntity hash={ data.transaction_hash } isLoading={ isPlaceholderData }/>
<TxEntity hash={ data.transaction_hash } isLoading={ isPlaceholderData } noCopy={ false }/>
</DetailsInfoItem>
<DetailsInfoItem
title="Block"
Expand Down
4 changes: 2 additions & 2 deletions ui/userOps/UserOpsContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ const UserOpsContent = ({ query, showTx = true, showSender = true }: Props) => {
/>
</Hide>
<Show below="lg" ssr={ false }>
{ query.data.items.map(((item, index) => (
{ query.data.items.map((item, index) => (
<UserOpsListItem
key={ item.hash + (query.isPlaceholderData ? String(index) : '') }
item={ item }
isLoading={ query.isPlaceholderData }
showTx={ showTx }
showSender={ showSender }
/>
))) }
)) }
</Show>
</>
) : null;
Expand Down
20 changes: 11 additions & 9 deletions ui/userOps/UserOpsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ const UserOpsTable = ({ items, isLoading, top, showTx, showSender }: Props) => {
</Tr>
</Thead>
<Tbody>
{ items.map((item, index) => (
<UserOpsTableItem
key={ (isLoading ? String(index) : '') }
item={ item }
isLoading={ isLoading }
showSender={ showSender }
showTx={ showTx }
/>
)) }
{ items.map((item, index) => {
return (
<UserOpsTableItem
key={ item.hash + (isLoading ? String(index) : '') }
item={ item }
isLoading={ isLoading }
showSender={ showSender }
showTx={ showTx }
/>
);
}) }
</Tbody>
</Table>
);
Expand Down

0 comments on commit 69f63c2

Please sign in to comment.