Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
52062102
Commit
52062102
authored
Oct 06, 2023
by
isstuev
Committed by
isstuev
Oct 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
batch entity
parent
bd9de9e9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
19 deletions
+54
-19
BlockDetails.tsx
ui/block/BlockDetails.tsx
+11
-2
LatestZkevmL2BatchItem.tsx
ui/home/LatestZkevmL2BatchItem.tsx
+2
-5
ZkEvmBatchEntityL2.tsx
ui/shared/entities/block/ZkEvmBatchEntityL2.tsx
+35
-0
TxDetails.tsx
ui/tx/TxDetails.tsx
+2
-5
ZkEvmL2TxnBatchDetails.tsx
ui/zkEvmL2TxnBatches/ZkEvmL2TxnBatchDetails.tsx
+0
-1
ZkEvmTxnBatchesListItem.tsx
ui/zkEvmL2TxnBatches/ZkEvmTxnBatchesListItem.tsx
+2
-3
ZkEvmTxnBatchesTableItem.tsx
ui/zkEvmL2TxnBatches/ZkEvmTxnBatchesTableItem.tsx
+2
-3
No files found.
ui/block/BlockDetails.tsx
View file @
52062102
...
...
@@ -120,6 +120,14 @@ const BlockDetails = ({ query }: Props) => {
);
})();
const
verificationTitle
=
(()
=>
{
if
(
config
.
features
.
zkEvmRollup
.
isEnabled
)
{
return
'
Sequenced by
'
;
}
return
config
.
chain
.
verificationType
===
'
validation
'
?
'
Validated by
'
:
'
Mined by
'
;
})();
return
(
<
Grid
columnGap=
{
8
}
...
...
@@ -193,7 +201,7 @@ const BlockDetails = ({ query }: Props) => {
</
DetailsInfoItem
>
)
}
<
DetailsInfoItem
title=
{
config
.
chain
.
verificationType
===
'
validation
'
?
'
Validated by
'
:
'
Mined by
'
}
title=
{
verificationTitle
}
hint=
"A block producer who successfully included the block onto the blockchain"
columnGap=
{
1
}
isLoading=
{
isPlaceholderData
}
...
...
@@ -205,7 +213,8 @@ const BlockDetails = ({ query }: Props) => {
{
/* api doesn't return the block processing time yet */
}
{
/* <Text>{ dayjs.duration(block.minedIn, 'second').humanize(true) }</Text> */
}
</
DetailsInfoItem
>
{
!
config
.
features
.
rollup
.
isEnabled
&&
!
totalReward
.
isEqualTo
(
ZERO
)
&&
!
config
.
UI
.
views
.
block
.
hiddenFields
?.
total_reward
&&
(
{
!
config
.
features
.
rollup
.
isEnabled
&&
!
config
.
features
.
zkEvmRollup
.
isEnabled
&&
!
totalReward
.
isEqualTo
(
ZERO
)
&&
!
config
.
UI
.
views
.
block
.
hiddenFields
?.
total_reward
&&
(
<
DetailsInfoItem
title=
"Block reward"
hint=
{
...
...
ui/home/LatestZkevmL2BatchItem.tsx
View file @
52062102
...
...
@@ -8,10 +8,8 @@ import React from 'react';
import
type
{
ZkEvmL2TxnBatchesItem
}
from
'
types/api/zkEvml2TxnBatches
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
BlockTimestamp
from
'
ui/blocks/BlockTimestamp
'
;
import
BlockEntityL2
from
'
ui/shared/entities/block/Block
EntityL2
'
;
import
ZkEvmBatchEntityL2
from
'
ui/shared/entities/block/ZkEvmBatch
EntityL2
'
;
import
ZkEvmL2TxnBatchStatus
from
'
ui/shared/statusTag/ZkEvmL2TxnBatchStatus
'
;
type
Props
=
{
...
...
@@ -34,7 +32,7 @@ const LatestZkevmL2BatchItem = ({ batch, isLoading }: Props) => {
p=
{
6
}
>
<
Flex
alignItems=
"center"
overflow=
"hidden"
w=
"100%"
mb=
{
3
}
>
<
Block
EntityL2
<
ZkEvmBatch
EntityL2
isLoading=
{
isLoading
}
number=
{
batch
.
number
}
tailLength=
{
2
}
...
...
@@ -42,7 +40,6 @@ const LatestZkevmL2BatchItem = ({ batch, isLoading }: Props) => {
lineHeight=
{
7
}
fontWeight=
{
500
}
mr=
"auto"
href=
{
route
({
pathname
:
'
/zkevm-l2-txn-batch/[number]
'
,
query
:
{
number
:
batch
.
number
.
toString
()
}
})
}
/>
<
BlockTimestamp
ts=
{
batch
.
timestamp
}
...
...
ui/shared/entities/block/ZkEvmBatchEntityL2.tsx
0 → 100644
View file @
52062102
import
{
chakra
}
from
'
@chakra-ui/react
'
;
import
_omit
from
'
lodash/omit
'
;
import
React
from
'
react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
config
from
'
configs/app
'
;
import
txBatchIcon
from
'
icons/txn_batches_slim.svg
'
;
import
*
as
BlockEntity
from
'
./BlockEntity
'
;
const
feature
=
config
.
features
.
zkEvmRollup
;
const
BlockEntityL2
=
(
props
:
BlockEntity
.
EntityProps
)
=>
{
const
linkProps
=
_omit
(
props
,
[
'
className
'
]);
const
partsProps
=
_omit
(
props
,
[
'
className
'
,
'
onClick
'
]);
if
(
!
feature
.
isEnabled
)
{
return
null
;
}
return
(
<
BlockEntity
.
Container
className=
{
props
.
className
}
>
<
BlockEntity
.
Icon
{
...
partsProps
}
asProp=
{
txBatchIcon
}
/>
<
BlockEntity
.
Link
{
...
linkProps
}
href=
{
feature
.
L1BaseUrl
+
route
({
pathname
:
'
/zkevm-l2-txn-batch/[number]
'
,
query
:
{
number
:
props
.
number
.
toString
()
}
})
}
>
<
BlockEntity
.
Content
{
...
partsProps
}
/>
</
BlockEntity
.
Link
>
</
BlockEntity
.
Container
>
);
};
export
default
chakra
(
BlockEntityL2
);
ui/tx/TxDetails.tsx
View file @
52062102
...
...
@@ -19,8 +19,6 @@ import { scroller, Element } from 'react-scroll';
import
{
ZKEVM_L2_TX_STATUSES
}
from
'
types/api/transaction
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
config
from
'
configs/app
'
;
import
clockIcon
from
'
icons/clock.svg
'
;
import
flameIcon
from
'
icons/flame.svg
'
;
...
...
@@ -40,7 +38,7 @@ import DetailsInfoItemDivider from 'ui/shared/DetailsInfoItemDivider';
import
DetailsSponsoredItem
from
'
ui/shared/DetailsSponsoredItem
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
BlockEntityL2
from
'
ui/shared/entities/block/Block
EntityL2
'
;
import
ZkEvmBatchEntityL2
from
'
ui/shared/entities/block/ZkEvmBatch
EntityL2
'
;
import
HashStringShortenDynamic
from
'
ui/shared/HashStringShortenDynamic
'
;
import
LogDecodedInputData
from
'
ui/shared/logs/LogDecodedInputData
'
;
import
RawInputData
from
'
ui/shared/RawInputData
'
;
...
...
@@ -199,10 +197,9 @@ const TxDetails = () => {
title=
"Tx batch"
isLoading=
{
isPlaceholderData
}
>
<
Block
EntityL2
<
ZkEvmBatch
EntityL2
isLoading=
{
isPlaceholderData
}
number=
{
data
.
zkevm_batch_number
}
href=
{
route
({
pathname
:
'
/zkevm-l2-txn-batch/[number]
'
,
query
:
{
number
:
data
.
zkevm_batch_number
.
toString
()
}
})
}
/>
</
DetailsInfoItem
>
)
}
...
...
ui/zkEvmL2TxnBatches/ZkEvmL2TxnBatchDetails.tsx
View file @
52062102
...
...
@@ -121,7 +121,6 @@ const ZkEvmL2TxnBatchDetails = ({ query }: Props) => {
</
DetailsInfoItem
>
<
DetailsInfoItem
title=
"Transactions"
hint=
"The number of transactions in the batch"
isLoading=
{
isPlaceholderData
}
>
<
Skeleton
isLoaded=
{
!
isPlaceholderData
}
>
...
...
ui/zkEvmL2TxnBatches/ZkEvmTxnBatchesListItem.tsx
View file @
52062102
...
...
@@ -7,7 +7,7 @@ import { route } from 'nextjs-routes';
import
config
from
'
configs/app
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
BlockEntityL2
from
'
ui/shared/entities/block/Block
EntityL2
'
;
import
ZkEvmBatchEntityL2
from
'
ui/shared/entities/block/ZkEvmBatch
EntityL2
'
;
import
TxEntityL1
from
'
ui/shared/entities/tx/TxEntityL1
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
ListItemMobileGrid
from
'
ui/shared/ListItemMobile/ListItemMobileGrid
'
;
...
...
@@ -29,13 +29,12 @@ const ZkEvmTxnBatchesListItem = ({ item, isLoading }: Props) => {
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Batch #
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
Block
EntityL2
<
ZkEvmBatch
EntityL2
isLoading=
{
isLoading
}
number=
{
item
.
number
}
fontSize=
"sm"
lineHeight=
{
5
}
fontWeight=
{
600
}
href=
{
route
({
pathname
:
'
/zkevm-l2-txn-batch/[number]
'
,
query
:
{
number
:
item
.
number
.
toString
()
}
})
}
/>
</
ListItemMobileGrid
.
Value
>
...
...
ui/zkEvmL2TxnBatches/ZkEvmTxnBatchesTableItem.tsx
View file @
52062102
...
...
@@ -7,7 +7,7 @@ import { route } from 'nextjs-routes';
import
config
from
'
configs/app
'
;
import
dayjs
from
'
lib/date/dayjs
'
;
import
BlockEntityL2
from
'
ui/shared/entities/block/Block
EntityL2
'
;
import
ZkEvmBatchEntityL2
from
'
ui/shared/entities/block/ZkEvmBatch
EntityL2
'
;
import
TxEntityL1
from
'
ui/shared/entities/tx/TxEntityL1
'
;
import
LinkInternal
from
'
ui/shared/LinkInternal
'
;
import
ZkEvmL2TxnBatchStatus
from
'
ui/shared/statusTag/ZkEvmL2TxnBatchStatus
'
;
...
...
@@ -26,13 +26,12 @@ const TxnBatchesTableItem = ({ item, isLoading }: Props) => {
return
(
<
Tr
>
<
Td
>
<
Block
EntityL2
<
ZkEvmBatch
EntityL2
isLoading=
{
isLoading
}
number=
{
item
.
number
}
fontSize=
"sm"
lineHeight=
{
5
}
fontWeight=
{
600
}
href=
{
route
({
pathname
:
'
/zkevm-l2-txn-batch/[number]
'
,
query
:
{
number
:
item
.
number
.
toString
()
}
})
}
/>
</
Td
>
<
Td
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment