Files
explore/ui/tx/details/TxDetailsOther.tsx
tom goriunovandGitHub 28b9b27e8b Update styles for detailed views on mobile and more (#2875)
* update styles of tx details

* common color for text separator

* remove bold fontWeight from some details items

* address, block, token, pool, user ops details pages

* refactor chain-specific views

* unify grid column template for detailed views

* remove TODO

* update margins for text separator

* update screenshots

* update margin between icon and text for mobile

* rename prop

* update layout of decoded input data

* update screenshots

* fix tac operation and zilliqa quorum snippets
2025-08-12 22:56:03 +02:00

63 lines
2.0 KiB
TypeScript

import { Box, Text } from '@chakra-ui/react';
import React from 'react';
import type { Transaction } from 'types/api/transaction';
import * as DetailedInfo from 'ui/shared/DetailedInfo/DetailedInfo';
import TextSeparator from 'ui/shared/TextSeparator';
type Props = Pick<Transaction, 'nonce' | 'type' | 'position'> & { queueIndex?: number };
const TxDetailsOther = ({ nonce, type, position, queueIndex }: Props) => {
return (
<>
<DetailedInfo.ItemLabel
hint="Other data related to this transaction"
>
Other
</DetailedInfo.ItemLabel>
<DetailedInfo.ItemValue multiRow>
{
[
typeof type === 'number' && (
<Box key="type">
<span>Txn type: </span>
<span>{ type }</span>
{ type === 2 && <Text as="span" ml={ 1 } color="text.secondary">(EIP-1559)</Text> }
{ type === 3 && <Text as="span" ml={ 1 } color="text.secondary">(EIP-4844)</Text> }
{ type === 4 && <Text as="span" ml={ 1 } color="text.secondary">(EIP-7702)</Text> }
</Box>
),
queueIndex !== undefined ? (
<Box key="queueIndex">
<span>Queue index: </span>
<span>{ queueIndex }</span>
</Box>
) : (
<Box key="nonce">
<span>Nonce: </span>
<span>{ nonce }</span>
</Box>
),
position !== null && position !== undefined && (
<Box key="position">
<span>Position: </span>
<span>{ position }</span>
</Box>
),
]
.filter(Boolean)
.map((item, index) => (
<React.Fragment key={ index }>
{ index !== 0 && <TextSeparator/> }
{ item }
</React.Fragment>
))
}
</DetailedInfo.ItemValue>
</>
);
};
export default TxDetailsOther;