Commit 02a122b4 authored by isstuev's avatar isstuev

review fix

parent a65be3d9
...@@ -8,7 +8,7 @@ export type ArbitrumL2MessagesItem = { ...@@ -8,7 +8,7 @@ export type ArbitrumL2MessagesItem = {
origination_timestamp: string | null; origination_timestamp: string | null;
origination_transaction_block_number: number; origination_transaction_block_number: number;
origination_transaction_hash: string; origination_transaction_hash: string;
status: string; status: 'initiated' | 'sent' | 'confirmed' | 'relayed';
} }
export type ArbitrumL2MessagesResponse = { export type ArbitrumL2MessagesResponse = {
......
...@@ -23,11 +23,11 @@ const TABS_HEIGHT = 88; ...@@ -23,11 +23,11 @@ const TABS_HEIGHT = 88;
interface Props { interface Props {
type?: BlockType; type?: BlockType;
query: QueryWithPagesResult<'blocks'>; query: QueryWithPagesResult<'blocks'>;
showSocketInfo?: boolean; enableSocket?: boolean;
top?: number; top?: number;
} }
const BlocksContent = ({ type, query, showSocketInfo = true, top }: Props) => { const BlocksContent = ({ type, query, enableSocket = true, top }: Props) => {
const queryClient = useQueryClient(); const queryClient = useQueryClient();
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const [ socketAlert, setSocketAlert ] = React.useState(''); const [ socketAlert, setSocketAlert ] = React.useState('');
...@@ -73,7 +73,7 @@ const BlocksContent = ({ type, query, showSocketInfo = true, top }: Props) => { ...@@ -73,7 +73,7 @@ const BlocksContent = ({ type, query, showSocketInfo = true, top }: Props) => {
topic: 'blocks:new_block', topic: 'blocks:new_block',
onSocketClose: handleSocketClose, onSocketClose: handleSocketClose,
onSocketError: handleSocketError, onSocketError: handleSocketError,
isDisabled: query.isPlaceholderData || query.isError || query.pagination.page !== 1 || !showSocketInfo, isDisabled: query.isPlaceholderData || query.isError || query.pagination.page !== 1 || !enableSocket,
}); });
useSocketMessage({ useSocketMessage({
channel, channel,
...@@ -84,7 +84,7 @@ const BlocksContent = ({ type, query, showSocketInfo = true, top }: Props) => { ...@@ -84,7 +84,7 @@ const BlocksContent = ({ type, query, showSocketInfo = true, top }: Props) => {
const content = query.data?.items ? ( const content = query.data?.items ? (
<> <>
<Box display={{ base: 'block', lg: 'none' }}> <Box display={{ base: 'block', lg: 'none' }}>
{ query.pagination.page === 1 && showSocketInfo && ( { query.pagination.page === 1 && enableSocket && (
<SocketNewItemsNotice.Mobile <SocketNewItemsNotice.Mobile
url={ window.location.href } url={ window.location.href }
num={ newItemsCount } num={ newItemsCount }
...@@ -101,7 +101,7 @@ const BlocksContent = ({ type, query, showSocketInfo = true, top }: Props) => { ...@@ -101,7 +101,7 @@ const BlocksContent = ({ type, query, showSocketInfo = true, top }: Props) => {
top={ top || (query.pagination.isVisible ? TABS_HEIGHT : 0) } top={ top || (query.pagination.isVisible ? TABS_HEIGHT : 0) }
page={ query.pagination.page } page={ query.pagination.page }
isLoading={ query.isPlaceholderData } isLoading={ query.isPlaceholderData }
showSocketInfo={ query.pagination.page === 1 && showSocketInfo } showSocketInfo={ query.pagination.page === 1 && enableSocket }
socketInfoNum={ newItemsCount } socketInfoNum={ newItemsCount }
socketInfoAlert={ socketAlert } socketInfoAlert={ socketAlert }
/> />
......
...@@ -70,7 +70,7 @@ const ZkEvmL2DepositsListItem = ({ item, isLoading }: Props) => { ...@@ -70,7 +70,7 @@ const ZkEvmL2DepositsListItem = ({ item, isLoading }: Props) => {
truncation="constant_long" truncation="constant_long"
/> />
) : ( ) : (
<chakra.span color="text_secondary"> <chakra.span>
Pending Claim Pending Claim
</chakra.span> </chakra.span>
) } ) }
......
...@@ -80,7 +80,7 @@ const ArbitrumL2MessagesListItem = ({ item, isLoading, direction }: Props) => { ...@@ -80,7 +80,7 @@ const ArbitrumL2MessagesListItem = ({ item, isLoading, direction }: Props) => {
truncation="constant_long" truncation="constant_long"
/> />
) : ( ) : (
<chakra.span color="text_secondary"> <chakra.span>
N/A N/A
</chakra.span> </chakra.span>
) } ) }
...@@ -107,7 +107,7 @@ const ArbitrumL2MessagesListItem = ({ item, isLoading, direction }: Props) => { ...@@ -107,7 +107,7 @@ const ArbitrumL2MessagesListItem = ({ item, isLoading, direction }: Props) => {
truncation="constant_long" truncation="constant_long"
/> />
) : ( ) : (
<chakra.span color="text_secondary"> <chakra.span>
N/A N/A
</chakra.span> </chakra.span>
) } ) }
......
...@@ -96,7 +96,7 @@ const ArbitrumL2TxnBatch = () => { ...@@ -96,7 +96,7 @@ const ArbitrumL2TxnBatch = () => {
{ {
id: 'blocks', id: 'blocks',
title: 'Blocks', title: 'Blocks',
component: <BlocksContent type="block" query={ batchBlocksQuery } showSocketInfo={ false } top={ hasPagination ? TABS_HEIGHT : 0 }/>, component: <BlocksContent type="block" query={ batchBlocksQuery } enableSocket={ false } top={ hasPagination ? TABS_HEIGHT : 0 }/>,
}, },
].filter(Boolean)), [ batchQuery, batchTxsQuery, batchBlocksQuery, hasPagination ]); ].filter(Boolean)), [ batchQuery, batchTxsQuery, batchBlocksQuery, hasPagination ]);
......
...@@ -19,6 +19,8 @@ const StatusTag = ({ type, text, errorText, isLoading, className }: Props) => { ...@@ -19,6 +19,8 @@ const StatusTag = ({ type, text, errorText, isLoading, className }: Props) => {
let icon: IconName; let icon: IconName;
let colorScheme; let colorScheme;
const capitalizedText = text.charAt(0).toUpperCase() + text.slice(1);
switch (type) { switch (type) {
case 'ok': case 'ok':
icon = 'status/success'; icon = 'status/success';
...@@ -38,7 +40,7 @@ const StatusTag = ({ type, text, errorText, isLoading, className }: Props) => { ...@@ -38,7 +40,7 @@ const StatusTag = ({ type, text, errorText, isLoading, className }: Props) => {
<Tooltip label={ errorText }> <Tooltip label={ errorText }>
<Tag colorScheme={ colorScheme } display="flex" isLoading={ isLoading } className={ className }> <Tag colorScheme={ colorScheme } display="flex" isLoading={ isLoading } className={ className }>
<IconSvg boxSize={ 2.5 } name={ icon } mr={ 1 } flexShrink={ 0 }/> <IconSvg boxSize={ 2.5 } name={ icon } mr={ 1 } flexShrink={ 0 }/>
<TagLabel display="block">{ text }</TagLabel> <TagLabel display="block">{ capitalizedText }</TagLabel>
</Tag> </Tag>
</Tooltip> </Tooltip>
); );
......
...@@ -70,7 +70,7 @@ const ZkEvmL2WithdrawalsListItem = ({ item, isLoading }: Props) => { ...@@ -70,7 +70,7 @@ const ZkEvmL2WithdrawalsListItem = ({ item, isLoading }: Props) => {
truncation="constant_long" truncation="constant_long"
/> />
) : ( ) : (
<chakra.span color="text_secondary"> <chakra.span>
Pending Claim Pending Claim
</chakra.span> </chakra.span>
) } ) }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment