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
ffc87f4d
Commit
ffc87f4d
authored
Feb 06, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
state, blobs and user ops tabs
parent
7f55da68
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
156 additions
and
162 deletions
+156
-162
CutLink.tsx
toolkit/components/CutLink/CutLink.tsx
+4
-0
Transaction.tsx
ui/pages/Transaction.tsx
+8
-8
BlobDataType.tsx
ui/shared/blob/BlobDataType.tsx
+4
-7
UserOpStatus.tsx
ui/shared/userOps/UserOpStatus.tsx
+1
-4
TxAllowedPeekers.tsx
ui/tx/TxAllowedPeekers.tsx
+0
-1
TxBlobs.tsx
ui/tx/TxBlobs.tsx
+9
-8
TxState.tsx
ui/tx/TxState.tsx
+9
-8
TxBlobListItem.tsx
ui/tx/blobs/TxBlobListItem.tsx
+2
-2
TxBlobsTable.tsx
ui/tx/blobs/TxBlobsTable.tsx
+12
-13
TxBlobsTableItem.tsx
ui/tx/blobs/TxBlobsTableItem.tsx
+11
-11
TxStateTable.tsx
ui/tx/state/TxStateTable.tsx
+15
-21
TxStateTableItem.tsx
ui/tx/state/TxStateTableItem.tsx
+12
-11
TxStateTokenIdList.tsx
ui/tx/state/TxStateTokenIdList.tsx
+8
-3
utils.tsx
ui/tx/state/utils.tsx
+15
-14
UserOpsContent.tsx
ui/userOps/UserOpsContent.tsx
+9
-8
UserOpsListItem.tsx
ui/userOps/UserOpsListItem.tsx
+2
-6
UserOpsTable.tsx
ui/userOps/UserOpsTable.tsx
+16
-17
UserOpsTableItem.tsx
ui/userOps/UserOpsTableItem.tsx
+19
-20
No files found.
toolkit/components/CutLink/CutLink.tsx
View file @
ffc87f4d
...
...
@@ -14,6 +14,10 @@ interface Props extends LinkProps {
const
ID
=
'
CutLink
'
;
// TODO @tom2drum another variant of CutLink
// ui/tx/TxAllowedPeekers.tsx
// ui/tx/state/TxStateTokenIdList.tsx
const
CutLink
=
(
props
:
Props
)
=>
{
const
{
children
,
id
=
ID
,
onClick
,
isExpanded
:
isExpandedProp
=
false
,
...
rest
}
=
props
;
...
...
ui/pages/Transaction.tsx
View file @
ffc87f4d
...
...
@@ -59,16 +59,16 @@ const TransactionPageContent = () => {
// { id: 'wrapped', title: 'Regular tx details', component: <TxDetailsWrapped data={ data.wrapped }/> } :
// undefined,
{
id
:
'
token_transfers
'
,
title
:
'
Token transfers
'
,
component
:
<
TxTokenTransfer
txQuery=
{
txQuery
}
/>
},
//
config.features.userOps.isEnabled ?
//
{ id: 'user_ops', title: 'User operations', component: <TxUserOps txQuery={ txQuery }/> } :
//
undefined,
config
.
features
.
userOps
.
isEnabled
?
{
id
:
'
user_ops
'
,
title
:
'
User operations
'
,
component
:
<
TxUserOps
txQuery=
{
txQuery
}
/>
}
:
undefined
,
{
id
:
'
internal
'
,
title
:
'
Internal txns
'
,
component
:
<
TxInternals
txQuery=
{
txQuery
}
/>
},
//
config.features.dataAvailability.isEnabled && txQuery.data?.blob_versioned_hashes?.length ?
//
{ id: 'blobs', title: 'Blobs', component: <TxBlobs txQuery={ txQuery }/> } :
//
undefined,
config
.
features
.
dataAvailability
.
isEnabled
&&
txQuery
.
data
?.
blob_versioned_hashes
?.
length
?
{
id
:
'
blobs
'
,
title
:
'
Blobs
'
,
component
:
<
TxBlobs
txQuery=
{
txQuery
}
/>
}
:
undefined
,
{
id
:
'
logs
'
,
title
:
'
Logs
'
,
component
:
<
TxLogs
txQuery=
{
txQuery
}
/>
},
//
{ id: 'state', title: 'State', component: <TxState txQuery={ txQuery }/> },
//
{ id: 'raw_trace', title: 'Raw trace', component: <TxRawTrace txQuery={ txQuery }/> },
{
id
:
'
state
'
,
title
:
'
State
'
,
component
:
<
TxState
txQuery=
{
txQuery
}
/>
},
{
id
:
'
raw_trace
'
,
title
:
'
Raw trace
'
,
component
:
<
TxRawTrace
txQuery=
{
txQuery
}
/>
},
].
filter
(
Boolean
);
})();
...
...
ui/shared/blob/BlobDataType.tsx
View file @
ffc87f4d
import
{
Flex
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
{
Flex
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
*
as
blobUtils
from
'
lib/blob
'
;
import
Skeleton
from
'
ui/shared/chakra/S
keleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/s
keleton
'
;
import
type
{
IconName
}
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
interface
Props
{
data
:
string
;
isLoading
?:
boolean
;
...
...
@@ -18,8 +17,6 @@ const TYPES: Record<string, { iconName: IconName; label: string }> = {
};
const
BlobDataType
=
({
data
,
isLoading
}:
Props
)
=>
{
const
iconColor
=
useColorModeValue
(
'
gray.500
'
,
'
gray.400
'
);
const
guessedType
=
React
.
useMemo
(()
=>
{
if
(
isLoading
)
{
return
;
...
...
@@ -48,8 +45,8 @@ const BlobDataType = ({ data, isLoading }: Props) => {
return
(
<
Flex
alignItems=
"center"
columnGap=
{
2
}
>
<
IconSvg
name=
{
iconName
}
boxSize=
{
5
}
color=
{
iconColor
}
isLoading=
{
isLoading
}
/>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
{
label
}
</
Skeleton
>
<
IconSvg
name=
{
iconName
}
boxSize=
{
5
}
color=
{
{
_light
:
'
gray.500
'
,
_dark
:
'
gray.400
'
}
}
isLoading=
{
isLoading
}
/>
<
Skeleton
loading=
{
isLoading
}
>
{
label
}
</
Skeleton
>
</
Flex
>
);
};
...
...
ui/shared/userOps/UserOpStatus.tsx
View file @
ffc87f4d
import
React
from
'
react
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
StatusTag
from
'
ui/shared/statusTag/StatusTag
'
;
type
Props
=
{
...
...
@@ -14,9 +13,7 @@ const UserOpStatus = ({ status, isLoading }: Props) => {
}
return
(
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
>
<
StatusTag
type=
{
status
===
true
?
'
ok
'
:
'
error
'
}
text=
{
status
===
true
?
'
Success
'
:
'
Failed
'
}
/>
</
Skeleton
>
<
StatusTag
isLoading=
{
isLoading
}
type=
{
status
===
true
?
'
ok
'
:
'
error
'
}
text=
{
status
===
true
?
'
Success
'
:
'
Failed
'
}
/>
);
};
...
...
ui/tx/TxAllowedPeekers.tsx
View file @
ffc87f4d
...
...
@@ -11,7 +11,6 @@ interface Props {
const
CUT_LENGTH
=
2
;
// TODO @tom2drum another variant of CutLink
const
TxAllowedPeekers
=
({
items
}:
Props
)
=>
{
const
[
isExpanded
,
setIsExpanded
]
=
React
.
useState
(
false
);
...
...
ui/tx/TxBlobs.tsx
View file @
ffc87f4d
import
{
Hide
,
Show
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
TX_BLOB
}
from
'
stubs/blobs
'
;
...
...
@@ -34,12 +34,12 @@ const TxBlobs = ({ txQuery }: Props) => {
const
content
=
data
?
(
<>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
TxBlobsTable
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
top=
{
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
/>
</
Hide
>
<
Show
below=
"lg"
ssr=
{
false
}
>
</
Box
>
<
Box
hideFrom=
"lg"
>
<
TxBlobsList
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
</
Show
>
</
Box
>
</>
)
:
null
;
...
...
@@ -52,11 +52,12 @@ const TxBlobs = ({ txQuery }: Props) => {
return
(
<
DataListDisplay
isError=
{
isError
||
txQuery
.
isError
}
items
=
{
data
?.
items
}
items
Num=
{
data
?.
items
.
length
}
emptyText=
"There are no blobs for this transaction."
content=
{
content
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
);
};
...
...
ui/tx/TxState.tsx
View file @
ffc87f4d
import
{
Hide
,
Show
,
Text
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Text
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
TX_STATE_CHANGES
}
from
'
stubs/txStateChanges
'
;
...
...
@@ -39,12 +39,12 @@ const TxState = ({ txQuery }: Props) => {
const
content
=
data
?
(
<>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
TxStateTable
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
top=
{
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
/>
</
Hide
>
<
Show
below=
"lg"
ssr=
{
false
}
>
</
Box
>
<
Box
hideFrom=
"lg"
>
<
TxStateList
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
</
Show
>
</
Box
>
</>
)
:
null
;
...
...
@@ -64,11 +64,12 @@ const TxState = ({ txQuery }: Props) => {
)
}
<
DataListDisplay
isError=
{
isError
||
txQuery
.
isError
}
items
=
{
data
?.
items
}
items
Num=
{
data
?.
items
.
length
}
emptyText=
"There are no state changes for this transaction."
content=
{
content
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
</>
);
};
...
...
ui/tx/blobs/TxBlobListItem.tsx
View file @
ffc87f4d
...
...
@@ -2,8 +2,8 @@ import React from 'react';
import
type
{
TxBlob
}
from
'
types/api/blobs
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
BlobDataType
from
'
ui/shared/blob/BlobDataType
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
BlobEntity
from
'
ui/shared/entities/blob/BlobEntity
'
;
import
ListItemMobileGrid
from
'
ui/shared/ListItemMobile/ListItemMobileGrid
'
;
...
...
@@ -29,7 +29,7 @@ const TxBlobListItem = ({ data, isLoading }: Props) => {
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Size, bytes
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
<
Skeleton
loading=
{
isLoading
}
>
{
size
.
toLocaleString
()
}
</
Skeleton
>
</
ListItemMobileGrid
.
Value
>
...
...
ui/tx/blobs/TxBlobsTable.tsx
View file @
ffc87f4d
import
{
Table
,
Tbody
,
Tr
,
Th
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
TxBlob
}
from
'
types/api/blobs
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
TxBlobsTableItem
from
'
./TxBlobsTableItem
'
;
...
...
@@ -16,20 +15,20 @@ interface Props {
const
TxInternalsTable
=
({
data
,
top
,
isLoading
}:
Props
)
=>
{
return
(
<
Table
>
<
T
head
top=
{
top
}
>
<
T
r
>
<
T
h
width=
"60%"
>
Blob hash
</
Th
>
<
T
h
width=
"20%"
>
Data type
</
Th
>
<
T
h
width=
"20%"
>
Size, bytes
</
Th
>
</
T
r
>
</
T
head
>
<
T
b
ody
>
<
Table
Root
>
<
T
ableHeaderSticky
top=
{
top
}
>
<
T
ableRow
>
<
T
ableColumnHeader
width=
"60%"
>
Blob hash
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"20%"
>
Data type
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"20%"
>
Size, bytes
</
TableColumnHeader
>
</
T
ableRow
>
</
T
ableHeaderSticky
>
<
T
ableB
ody
>
{
data
.
map
((
item
,
index
)
=>
(
<
TxBlobsTableItem
key=
{
item
.
hash
+
(
isLoading
?
index
:
''
)
}
data=
{
item
}
isLoading=
{
isLoading
}
/>
))
}
</
T
b
ody
>
</
Table
>
</
T
ableB
ody
>
</
Table
Root
>
);
};
...
...
ui/tx/blobs/TxBlobsTableItem.tsx
View file @
ffc87f4d
import
{
Tr
,
Td
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
TxBlob
}
from
'
types/api/blobs
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
BlobDataType
from
'
ui/shared/blob/BlobDataType
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
BlobEntity
from
'
ui/shared/entities/blob/BlobEntity
'
;
interface
Props
{
...
...
@@ -16,19 +16,19 @@ const TxBlobsTableItem = ({ data, isLoading }: Props) => {
const
size
=
data
.
blob_data
?
data
.
blob_data
.
replace
(
'
0x
'
,
''
).
length
/
2
:
'
-
'
;
return
(
<
T
r
alignItems=
"top"
>
<
T
d
>
<
T
ableRow
alignItems=
"top"
>
<
T
ableCell
>
<
BlobEntity
hash=
{
data
.
hash
}
noIcon
isLoading=
{
isLoading
}
/>
</
T
d
>
<
T
d
verticalAlign=
"middle"
>
</
T
ableCell
>
<
T
ableCell
verticalAlign=
"middle"
>
{
data
.
blob_data
?
<
BlobDataType
isLoading=
{
isLoading
}
data=
{
data
.
blob_data
}
/>
:
'
-
'
}
</
T
d
>
<
T
d
verticalAlign=
"middle"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
>
</
T
ableCell
>
<
T
ableCell
verticalAlign=
"middle"
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
>
{
size
.
toLocaleString
()
}
</
Skeleton
>
</
T
d
>
</
T
r
>
</
T
ableCell
>
</
T
ableRow
>
);
};
...
...
ui/tx/state/TxStateTable.tsx
View file @
ffc87f4d
import
{
Table
,
Tbody
,
Tr
,
Th
,
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
TxStateChange
}
from
'
types/api/txStateChanges
'
;
import
{
AddressHighlightProvider
}
from
'
lib/contexts/addressHighlight
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
TxStateTableItem
from
'
ui/tx/state/TxStateTableItem
'
;
interface
Props
{
...
...
@@ -21,21 +15,21 @@ interface Props {
const
TxStateTable
=
({
data
,
isLoading
,
top
}:
Props
)
=>
{
return
(
<
AddressHighlightProvider
>
<
Table
minWidth=
"1000px"
w=
"100%"
>
<
T
head
top=
{
top
}
>
<
T
r
>
<
T
h
width=
"140px"
>
Type
</
Th
>
<
T
h
width=
"160px"
>
Address
</
Th
>
<
T
h
width=
"33%"
isNumeric
>
Before
</
Th
>
<
T
h
width=
"33%"
isNumeric
>
After
</
Th
>
<
T
h
width=
"33%"
isNumeric
>
Change
</
Th
>
<
T
h
width=
"150px"
minW=
"80px"
maxW=
"150px"
>
Token ID
</
Th
>
</
T
r
>
</
T
head
>
<
T
b
ody
>
<
Table
Root
minWidth=
"1000px"
w=
"100%"
>
<
T
ableHeaderSticky
top=
{
top
}
>
<
T
ableRow
>
<
T
ableColumnHeader
width=
"140px"
>
Type
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"160px"
>
Address
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"33%"
isNumeric
>
Before
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"33%"
isNumeric
>
After
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"33%"
isNumeric
>
Change
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"150px"
minW=
"80px"
maxW=
"150px"
>
Token ID
</
TableColumnHeader
>
</
T
ableRow
>
</
T
ableHeaderSticky
>
<
T
ableB
ody
>
{
data
.
map
((
item
,
index
)
=>
<
TxStateTableItem
data=
{
item
}
key=
{
index
}
isLoading=
{
isLoading
}
/>)
}
</
T
b
ody
>
</
Table
>
</
T
ableB
ody
>
</
Table
Root
>
</
AddressHighlightProvider
>
);
};
...
...
ui/tx/state/TxStateTableItem.tsx
View file @
ffc87f4d
import
{
Tr
,
Td
,
Box
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
TxStateChange
}
from
'
types/api/txStateChanges
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
{
getStateElements
}
from
'
./utils
'
;
...
...
@@ -16,13 +17,13 @@ const TxStateTableItem = ({ data, isLoading }: Props) => {
const
{
before
,
after
,
change
,
tag
,
tokenId
}
=
getStateElements
(
data
,
isLoading
);
return
(
<
T
r
>
<
T
d
>
<
T
ableRow
>
<
T
ableCell
>
<
Box
py=
"3px"
>
{
tag
}
</
Box
>
</
T
d
>
<
T
d
>
</
T
ableCell
>
<
T
ableCell
>
<
AddressEntity
address=
{
data
.
address
}
isLoading=
{
isLoading
}
...
...
@@ -30,12 +31,12 @@ const TxStateTableItem = ({ data, isLoading }: Props) => {
my=
"7px"
w=
"100%"
/>
</
T
d
>
<
T
d
isNumeric
><
Box
py=
"7px"
>
{
before
}
</
Box
></
Td
>
<
T
d
isNumeric
><
Box
py=
"7px"
>
{
after
}
</
Box
></
Td
>
<
T
d
isNumeric
><
Box
py=
"7px"
>
{
change
}
</
Box
></
Td
>
<
T
d
>
{
tokenId
}
</
Td
>
</
T
r
>
</
T
ableCell
>
<
T
ableCell
isNumeric
><
Box
py=
"7px"
>
{
before
}
</
Box
></
TableCell
>
<
T
ableCell
isNumeric
><
Box
py=
"7px"
>
{
after
}
</
Box
></
TableCell
>
<
T
ableCell
isNumeric
><
Box
py=
"7px"
>
{
change
}
</
Box
></
TableCell
>
<
T
ableCell
>
{
tokenId
}
</
TableCell
>
</
T
ableRow
>
);
};
...
...
ui/tx/state/TxStateTokenIdList.tsx
View file @
ffc87f4d
import
{
Flex
,
Text
,
Link
,
useBoolean
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Text
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
interface
Props
{
...
...
@@ -10,7 +11,11 @@ interface Props {
}
const
TxStateTokenIdList
=
({
items
,
tokenAddress
,
isLoading
}:
Props
)
=>
{
const
[
isCut
,
setIsCut
]
=
useBoolean
(
true
);
const
[
isCut
,
setIsCut
]
=
React
.
useState
(
true
);
const
handleToggle
=
React
.
useCallback
(()
=>
{
setIsCut
((
prev
)
=>
!
prev
);
},
[]);
return
(
<
Flex
flexDir=
"column"
rowGap=
{
2
}
>
...
...
@@ -33,7 +38,7 @@ const TxStateTokenIdList = ({ items, tokenAddress, isLoading }: Props) => {
fontWeight=
{
400
}
textDecoration=
"underline dashed"
_hover=
{
{
textDecoration
:
'
underline dashed
'
,
color
:
'
link_hovered
'
}
}
onClick=
{
setIsCut
.
t
oggle
}
onClick=
{
handleT
oggle
}
pb=
{
{
base
:
'
5px
'
,
md
:
0
}
}
>
View
{
isCut
?
'
more
'
:
'
less
'
}
...
...
ui/tx/state/utils.tsx
View file @
ffc87f4d
import
{
Flex
,
Tooltip
}
from
'
@chakra-ui/react
'
;
import
{
Flex
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
...
...
@@ -9,8 +9,9 @@ import { ZERO_ADDRESS } from 'lib/consts';
import
{
nbsp
,
space
}
from
'
lib/html-entities
'
;
import
getNetworkValidatorTitle
from
'
lib/networks/getNetworkValidatorTitle
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
{
Badge
}
from
'
toolkit/chakra/badge
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
{
Tooltip
}
from
'
toolkit/chakra/tooltip
'
;
import
NftEntity
from
'
ui/shared/entities/nft/NftEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
...
...
@@ -20,10 +21,10 @@ export function getStateElements(data: TxStateChange, isLoading?: boolean) {
const
tag
=
(()
=>
{
if
(
data
.
is_miner
)
{
return
(
<
Tooltip
label
=
"A block producer who successfully included the block into the blockchain"
>
<
Tag
textTransform=
"capitalize"
colorScheme=
"yellow"
isL
oading=
{
isLoading
}
>
<
Tooltip
content
=
"A block producer who successfully included the block into the blockchain"
>
<
Badge
textTransform=
"capitalize"
colorPalette=
"yellow"
l
oading=
{
isLoading
}
>
{
getNetworkValidatorTitle
()
}
</
Tag
>
</
Badge
>
</
Tooltip
>
);
}
...
...
@@ -40,8 +41,8 @@ export function getStateElements(data: TxStateChange, isLoading?: boolean) {
if
(
changeDirection
)
{
const
text
=
changeDirection
===
'
from
'
?
'
Mint
'
:
'
Burn
'
;
return
(
<
Tooltip
label
=
"Address used in tokens mintings and burnings"
>
<
Tag
textTransform=
"capitalize"
colorScheme=
"yellow"
isLoading=
{
isLoading
}
>
{
text
}
address
</
Tag
>
<
Tooltip
content
=
"Address used in tokens mintings and burnings"
>
<
Badge
textTransform=
"capitalize"
colorPalette=
"yellow"
loading=
{
isLoading
}
>
{
text
}
address
</
Badge
>
</
Tooltip
>
);
}
...
...
@@ -60,17 +61,17 @@ export function getStateElements(data: TxStateChange, isLoading?: boolean) {
return
{
before
:
(
<
Skeleton
isLoaded=
{
!
isLoading
}
wordBreak=
"break-all"
display=
"inline-block"
>
<
Skeleton
loading=
{
isLoading
}
wordBreak=
"break-all"
display=
"inline-block"
>
{
beforeBn
.
toFormat
()
}
{
currencyUnits
.
ether
}
</
Skeleton
>
),
after
:
(
<
Skeleton
isLoaded=
{
!
isLoading
}
wordBreak=
"break-all"
display=
"inline-block"
>
<
Skeleton
loading=
{
isLoading
}
wordBreak=
"break-all"
display=
"inline-block"
>
{
afterBn
.
toFormat
()
}
{
currencyUnits
.
ether
}
</
Skeleton
>
),
change
:
(
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
color=
{
changeColor
}
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
color=
{
changeColor
}
>
<
span
>
{
changeSign
}{
nbsp
}{
differenceBn
.
abs
().
toFormat
()
}
</
span
>
</
Skeleton
>
),
...
...
@@ -106,7 +107,7 @@ export function getStateElements(data: TxStateChange, isLoading?: boolean) {
const
changeSign
=
differenceBn
.
isGreaterThanOrEqualTo
(
0
)
?
'
+
'
:
'
-
'
;
return
(
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
color=
{
changeColor
}
wordBreak=
"break-all"
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
color=
{
changeColor
}
wordBreak=
"break-all"
>
<
span
>
{
changeSign
}{
nbsp
}{
differenceBn
.
abs
().
toFormat
()
}
</
span
>
</
Skeleton
>
);
...
...
@@ -133,14 +134,14 @@ export function getStateElements(data: TxStateChange, isLoading?: boolean) {
return
{
before
:
data
.
balance_before
?
(
<
Flex
whiteSpace=
"pre-wrap"
justifyContent=
{
{
base
:
'
flex-start
'
,
lg
:
'
flex-end
'
}
}
flexWrap=
"wrap"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
wordBreak=
"break-all"
>
{
beforeBn
.
toFormat
()
}
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
wordBreak=
"break-all"
>
{
beforeBn
.
toFormat
()
}
</
Skeleton
>
<
span
>
{
space
}
</
span
>
{
tokenLink
}
</
Flex
>
)
:
null
,
after
:
data
.
balance_after
?
(
<
Flex
whiteSpace=
"pre-wrap"
justifyContent=
{
{
base
:
'
flex-start
'
,
lg
:
'
flex-end
'
}
}
flexWrap=
"wrap"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
wordBreak=
"break-all"
>
{
afterBn
.
toFormat
()
}
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
wordBreak=
"break-all"
>
{
afterBn
.
toFormat
()
}
</
Skeleton
>
<
span
>
{
space
}
</
span
>
{
tokenLink
}
</
Flex
>
...
...
ui/userOps/UserOpsContent.tsx
View file @
ffc87f4d
import
{
Hide
,
Show
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
ActionBar
,
{
ACTION_BAR_HEIGHT_DESKTOP
}
from
'
ui/shared/ActionBar
'
;
...
...
@@ -23,7 +23,7 @@ const UserOpsContent = ({ query, showTx = true, showSender = true }: Props) => {
const
content
=
query
.
data
?.
items
?
(
<>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
UserOpsTable
items=
{
query
.
data
.
items
}
top=
{
query
.
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
...
...
@@ -31,8 +31,8 @@ const UserOpsContent = ({ query, showTx = true, showSender = true }: Props) => {
showTx=
{
showTx
}
showSender=
{
showSender
}
/>
</
Hide
>
<
Show
below=
"lg"
ssr=
{
false
}
>
</
Box
>
<
Box
hideFrom=
"lg"
>
{
query
.
data
.
items
.
map
((
item
,
index
)
=>
(
<
UserOpsListItem
key=
{
item
.
hash
+
(
query
.
isPlaceholderData
?
String
(
index
)
:
''
)
}
...
...
@@ -42,7 +42,7 @@ const UserOpsContent = ({ query, showTx = true, showSender = true }: Props) => {
showSender=
{
showSender
}
/>
))
}
</
Show
>
</
Box
>
</>
)
:
null
;
...
...
@@ -55,11 +55,12 @@ const UserOpsContent = ({ query, showTx = true, showSender = true }: Props) => {
return
(
<
DataListDisplay
isError=
{
query
.
isError
}
items
=
{
query
.
data
?.
items
}
items
Num=
{
query
.
data
?.
items
?.
length
}
emptyText=
"There are no user operations."
content=
{
content
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
);
};
...
...
ui/userOps/UserOpsListItem.tsx
View file @
ffc87f4d
...
...
@@ -3,7 +3,6 @@ import React from 'react';
import
type
{
UserOpsItem
}
from
'
types/api/userOps
'
;
import
config
from
'
configs/app
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
AddressStringOrParam
from
'
ui/shared/entities/address/AddressStringOrParam
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
...
...
@@ -76,8 +75,7 @@ const UserOpsListItem = ({ item, isLoading, showTx, showSender }: Props) => {
<
BlockEntity
number=
{
Number
(
item
.
block_number
)
}
isLoading=
{
isLoading
}
fontSize=
"sm"
lineHeight=
{
5
}
textStyle=
"sm"
noIcon
/>
</
ListItemMobileGrid
.
Value
>
...
...
@@ -86,9 +84,7 @@ const UserOpsListItem = ({ item, isLoading, showTx, showSender }: Props) => {
<>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Fee
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
<
CurrencyValue
value=
{
item
.
fee
}
isLoading=
{
isLoading
}
accuracy=
{
8
}
currency=
{
config
.
chain
.
currency
.
symbol
}
/>
</
Skeleton
>
<
CurrencyValue
value=
{
item
.
fee
}
isLoading=
{
isLoading
}
accuracy=
{
8
}
currency=
{
config
.
chain
.
currency
.
symbol
}
/>
</
ListItemMobileGrid
.
Value
>
</>
)
}
...
...
ui/userOps/UserOpsTable.tsx
View file @
ffc87f4d
import
{
Table
,
Tbody
,
Th
,
Tr
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
UserOpsItem
}
from
'
types/api/userOps
'
;
import
config
from
'
configs/app
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
UserOpsTableItem
from
'
./UserOpsTableItem
'
;
...
...
@@ -18,19 +17,19 @@ import UserOpsTableItem from './UserOpsTableItem';
const
UserOpsTable
=
({
items
,
isLoading
,
top
,
showTx
,
showSender
}:
Props
)
=>
{
return
(
<
Table
minW=
"1000px"
>
<
T
head
top=
{
top
}
>
<
T
r
>
<
T
h
w=
"60%"
>
User op hash
</
Th
>
<
T
h
w=
"110px"
>
Age
</
Th
>
<
T
h
w=
"140px"
>
Status
</
Th
>
{
showSender
&&
<
T
h
w=
"160px"
>
Sender
</
Th
>
}
{
showTx
&&
<
T
h
w=
"160px"
>
Tx hash
</
Th
>
}
<
T
h
w=
"40%"
>
Block
</
Th
>
{
!
config
.
UI
.
views
.
tx
.
hiddenFields
?.
tx_fee
&&
<
T
h
w=
"120px"
isNumeric
>
{
`Fee ${ config.chain.currency.symbol }`
}
</
Th
>
}
</
T
r
>
</
T
head
>
<
T
b
ody
>
<
Table
Root
minW=
"1000px"
>
<
T
ableHeaderSticky
top=
{
top
}
>
<
T
ableRow
>
<
T
ableColumnHeader
w=
"60%"
>
User op hash
</
TableColumnHeader
>
<
T
ableColumnHeader
w=
"110px"
>
Age
</
TableColumnHeader
>
<
T
ableColumnHeader
w=
"140px"
>
Status
</
TableColumnHeader
>
{
showSender
&&
<
T
ableColumnHeader
w=
"160px"
>
Sender
</
TableColumnHeader
>
}
{
showTx
&&
<
T
ableColumnHeader
w=
"160px"
>
Tx hash
</
TableColumnHeader
>
}
<
T
ableColumnHeader
w=
"40%"
>
Block
</
TableColumnHeader
>
{
!
config
.
UI
.
views
.
tx
.
hiddenFields
?.
tx_fee
&&
<
T
ableColumnHeader
w=
"120px"
isNumeric
>
{
`Fee ${ config.chain.currency.symbol }`
}
</
TableColumnHeader
>
}
</
T
ableRow
>
</
T
ableHeaderSticky
>
<
T
ableB
ody
>
{
items
.
map
((
item
,
index
)
=>
{
return
(
<
UserOpsTableItem
...
...
@@ -42,8 +41,8 @@ const UserOpsTable = ({ items, isLoading, top, showTx, showSender }: Props) => {
/>
);
})
}
</
T
b
ody
>
</
Table
>
</
T
ableB
ody
>
</
Table
Root
>
);
};
...
...
ui/userOps/UserOpsTableItem.tsx
View file @
ffc87f4d
import
{
Td
,
Tr
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
UserOpsItem
}
from
'
types/api/userOps
'
;
import
config
from
'
configs/app
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
CurrencyValue
from
'
ui/shared/CurrencyValue
'
;
import
AddressStringOrParam
from
'
ui/shared/entities/address/AddressStringOrParam
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
...
...
@@ -21,55 +21,54 @@ import UserOpStatus from 'ui/shared/userOps/UserOpStatus';
const
UserOpsTableItem
=
({
item
,
isLoading
,
showTx
,
showSender
}:
Props
)
=>
{
return
(
<
T
r
>
<
T
d
verticalAlign=
"middle"
>
<
T
ableRow
>
<
T
ableCell
verticalAlign=
"middle"
>
<
UserOpEntity
hash=
{
item
.
hash
}
isLoading=
{
isLoading
}
noIcon
fontWeight=
{
700
}
truncation=
"constant_long"
/>
</
T
d
>
<
T
d
verticalAlign=
"middle"
>
</
T
ableCell
>
<
T
ableCell
verticalAlign=
"middle"
>
<
TimeAgoWithTooltip
timestamp=
{
item
.
timestamp
}
isLoading=
{
isLoading
}
color=
"text
_
secondary"
color=
"text
.
secondary"
display=
"inline-block"
/>
</
T
d
>
<
T
d
verticalAlign=
"middle"
>
</
T
ableCell
>
<
T
ableCell
verticalAlign=
"middle"
>
<
UserOpStatus
status=
{
item
.
status
}
isLoading=
{
isLoading
}
/>
</
T
d
>
</
T
ableCell
>
{
showSender
&&
(
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
AddressStringOrParam
address=
{
item
.
address
}
isLoading=
{
isLoading
}
truncation=
"constant"
/>
</
T
d
>
</
T
ableCell
>
)
}
{
showTx
&&
(
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
TxEntity
hash=
{
item
.
transaction_hash
}
isLoading=
{
isLoading
}
truncation=
"constant"
noIcon
/>
</
T
d
>
</
T
ableCell
>
)
}
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
BlockEntity
number=
{
Number
(
item
.
block_number
)
}
isLoading=
{
isLoading
}
fontSize=
"sm"
lineHeight=
{
5
}
textStyle=
"sm"
noIcon
/>
</
T
d
>
</
T
ableCell
>
{
!
config
.
UI
.
views
.
tx
.
hiddenFields
?.
tx_fee
&&
(
<
T
d
verticalAlign=
"middle"
isNumeric
>
<
T
ableCell
verticalAlign=
"middle"
isNumeric
>
<
CurrencyValue
value=
{
item
.
fee
}
isLoading=
{
isLoading
}
accuracy=
{
8
}
/>
</
T
d
>
</
T
ableCell
>
)
}
</
T
r
>
</
T
ableRow
>
);
};
...
...
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