mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* basic components and address page refactoring * second part of refactoring * third part of refactoring * NativeCoinValue component * more refactoring * rename TruncatedValue into TruncatedText * minor fixes * refactor block details * fix layout of value and fee in tx table * update screenshots * different units for tooltip and stats widget small value fix * update screenshots * update tx table screenshot * fix copy button vertical alignment
81 lines
2.4 KiB
TypeScript
81 lines
2.4 KiB
TypeScript
import { chakra } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import type { ScrollL2MessageItem } from 'types/api/scrollL2';
|
|
|
|
import config from 'configs/app';
|
|
import { Skeleton } from 'toolkit/chakra/skeleton';
|
|
import { TableCell, TableRow } from 'toolkit/chakra/table';
|
|
import BlockEntity from 'ui/shared/entities/block/BlockEntity';
|
|
import TxEntity from 'ui/shared/entities/tx/TxEntity';
|
|
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
|
|
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
|
|
import NativeCoinValue from 'ui/shared/value/NativeCoinValue';
|
|
|
|
const rollupFeature = config.features.rollup;
|
|
|
|
type Props = { item: ScrollL2MessageItem; isLoading?: boolean };
|
|
|
|
const ScrollL2WithdrawalsTableItem = ({ item, isLoading }: Props) => {
|
|
if (!rollupFeature.isEnabled || rollupFeature.type !== 'scroll') {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<TableRow>
|
|
<TableCell verticalAlign="middle">
|
|
<BlockEntity
|
|
number={ item.origination_transaction_block_number }
|
|
isLoading={ isLoading }
|
|
fontWeight={ 600 }
|
|
noIcon
|
|
/>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
<Skeleton loading={ isLoading }>
|
|
<span>{ item.id }</span>
|
|
</Skeleton>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
<TxEntity
|
|
isLoading={ isLoading }
|
|
hash={ item.origination_transaction_hash }
|
|
truncation="constant_long"
|
|
noIcon
|
|
/>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle" pr={ 12 }>
|
|
<TimeWithTooltip
|
|
timestamp={ item.origination_timestamp }
|
|
isLoading={ isLoading }
|
|
color="text.secondary"
|
|
/>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
{ item.completion_transaction_hash ? (
|
|
<TxEntityL1
|
|
isLoading={ isLoading }
|
|
hash={ item.completion_transaction_hash }
|
|
truncation="constant_long"
|
|
noIcon
|
|
noCopy
|
|
/>
|
|
) : (
|
|
<chakra.span color="text.secondary">
|
|
Pending Claim
|
|
</chakra.span>
|
|
) }
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle" isNumeric>
|
|
<NativeCoinValue
|
|
amount={ item.value }
|
|
noSymbol
|
|
loading={ isLoading }
|
|
/>
|
|
</TableCell>
|
|
</TableRow>
|
|
);
|
|
};
|
|
|
|
export default ScrollL2WithdrawalsTableItem;
|