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
ba2a3e2e
Commit
ba2a3e2e
authored
Feb 18, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal txs for address
parent
6781c5e1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
71 deletions
+69
-71
AddressInternalTxs.tsx
ui/address/AddressInternalTxs.tsx
+10
-9
InternalTxsListItem.tsx
ui/internalTxs/InternalTxsListItem.tsx
+9
-10
InternalTxsTable.tsx
ui/internalTxs/InternalTxsTable.tsx
+15
-16
InternalTxsTableItem.tsx
ui/internalTxs/InternalTxsTableItem.tsx
+20
-22
Address.tsx
ui/pages/Address.tsx
+6
-6
InternalTxs.tsx
ui/pages/InternalTxs.tsx
+9
-8
No files found.
ui/address/AddressInternalTxs.tsx
View file @
ba2a3e2e
import
{
Show
,
Hide
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -70,19 +70,19 @@ const AddressInternalTxs = ({ scrollRef, shouldRender = true, isQueryEnabled = t
...
@@ -70,19 +70,19 @@ const AddressInternalTxs = ({ scrollRef, shouldRender = true, isQueryEnabled = t
const
content
=
data
?.
items
?
(
const
content
=
data
?.
items
?
(
<>
<>
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Box
hideFrom=
"lg"
>
<
InternalTxsList
data=
{
data
.
items
}
currentAddress=
{
hash
}
isLoading=
{
isPlaceholderData
}
/>
<
InternalTxsList
data=
{
data
.
items
}
currentAddress=
{
hash
}
isLoading=
{
isPlaceholderData
}
/>
</
Show
>
</
Box
>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
InternalTxsTable
data=
{
data
.
items
}
currentAddress=
{
hash
}
isLoading=
{
isPlaceholderData
}
/>
<
InternalTxsTable
data=
{
data
.
items
}
currentAddress=
{
hash
}
isLoading=
{
isPlaceholderData
}
/>
</
Hide
>
</
Box
>
</>
</>
)
:
null
;
)
:
null
;
const
actionBar
=
(
const
actionBar
=
(
<
ActionBar
mt=
{
-
6
}
justifyContent=
"left"
>
<
ActionBar
mt=
{
-
6
}
justifyContent=
"left"
>
<
AddressTxsFilter
<
AddressTxsFilter
defaultFilter
=
{
filterValue
}
initialValue
=
{
filterValue
}
onFilterChange=
{
handleFilterChange
}
onFilterChange=
{
handleFilterChange
}
hasActiveFilter=
{
Boolean
(
filterValue
)
}
hasActiveFilter=
{
Boolean
(
filterValue
)
}
isLoading=
{
pagination
.
isLoading
}
isLoading=
{
pagination
.
isLoading
}
...
@@ -100,12 +100,13 @@ const AddressInternalTxs = ({ scrollRef, shouldRender = true, isQueryEnabled = t
...
@@ -100,12 +100,13 @@ const AddressInternalTxs = ({ scrollRef, shouldRender = true, isQueryEnabled = t
return
(
return
(
<
DataListDisplay
<
DataListDisplay
isError=
{
isError
}
isError=
{
isError
}
items
=
{
data
?.
items
}
items
Num=
{
data
?.
items
.
length
}
filterProps=
{
{
emptyFilteredText
:
`Couldn${ apos }t find any transaction that matches your query.`
,
hasActiveFilters
:
Boolean
(
filterValue
)
}
}
filterProps=
{
{
emptyFilteredText
:
`Couldn${ apos }t find any transaction that matches your query.`
,
hasActiveFilters
:
Boolean
(
filterValue
)
}
}
emptyText=
"There are no internal transactions for this address."
emptyText=
"There are no internal transactions for this address."
content=
{
content
}
actionBar=
{
actionBar
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
);
);
};
};
...
...
ui/internalTxs/InternalTxsListItem.tsx
View file @
ba2a3e2e
...
@@ -6,9 +6,9 @@ import type { InternalTransaction } from 'types/api/internalTransaction';
...
@@ -6,9 +6,9 @@ import type { InternalTransaction } from 'types/api/internalTransaction';
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
Badge
}
from
'
toolkit/chakra/badge
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
...
@@ -38,7 +38,7 @@ const InternalTxsListItem = ({
...
@@ -38,7 +38,7 @@ const InternalTxsListItem = ({
return
(
return
(
<
ListItemMobile
rowGap=
{
3
}
>
<
ListItemMobile
rowGap=
{
3
}
>
<
Flex
columnGap=
{
2
}
>
<
Flex
columnGap=
{
2
}
>
{
typeTitle
&&
<
Tag
colorScheme=
"cyan"
isLoading=
{
isLoading
}
>
{
typeTitle
}
</
Tag
>
}
{
typeTitle
&&
<
Badge
colorPalette=
"cyan"
loading=
{
isLoading
}
>
{
typeTitle
}
</
Badge
>
}
<
TxStatus
status=
{
success
?
'
ok
'
:
'
error
'
}
errorText=
{
error
}
isLoading=
{
isLoading
}
/>
<
TxStatus
status=
{
success
?
'
ok
'
:
'
error
'
}
errorText=
{
error
}
isLoading=
{
isLoading
}
/>
</
Flex
>
</
Flex
>
<
Flex
justifyContent=
"space-between"
width=
"100%"
>
<
Flex
justifyContent=
"space-between"
width=
"100%"
>
...
@@ -56,14 +56,13 @@ const InternalTxsListItem = ({
...
@@ -56,14 +56,13 @@ const InternalTxsListItem = ({
fontSize=
"sm"
fontSize=
"sm"
/>
/>
</
Flex
>
</
Flex
>
<
HStack
spacing
=
{
1
}
>
<
HStack
gap
=
{
1
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Block
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Block
</
Skeleton
>
<
BlockEntity
<
BlockEntity
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
number=
{
blockNumber
}
number=
{
blockNumber
}
noIcon
noIcon
fontSize=
"sm"
textStyle=
"sm"
lineHeight=
{
5
}
/>
/>
</
HStack
>
</
HStack
>
<
AddressFromTo
<
AddressFromTo
...
@@ -73,9 +72,9 @@ const InternalTxsListItem = ({
...
@@ -73,9 +72,9 @@ const InternalTxsListItem = ({
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
w=
"100%"
w=
"100%"
/>
/>
<
HStack
spacing
=
{
3
}
>
<
HStack
gap
=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Value
{
currencyUnits
.
ether
}
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Value
{
currencyUnits
.
ether
}
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
minW=
{
6
}
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
minW=
{
6
}
>
<
span
>
{
BigNumber
(
value
).
div
(
BigNumber
(
10
**
config
.
chain
.
currency
.
decimals
)).
toFormat
()
}
</
span
>
<
span
>
{
BigNumber
(
value
).
div
(
BigNumber
(
10
**
config
.
chain
.
currency
.
decimals
)).
toFormat
()
}
</
span
>
</
Skeleton
>
</
Skeleton
>
</
HStack
>
</
HStack
>
...
...
ui/internalTxs/InternalTxsTable.tsx
View file @
ba2a3e2e
import
{
Table
,
Tbody
,
Tr
,
Th
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
InternalTransaction
}
from
'
types/api/internalTransaction
'
;
import
type
{
InternalTransaction
}
from
'
types/api/internalTransaction
'
;
import
{
AddressHighlightProvider
}
from
'
lib/contexts/addressHighlight
'
;
import
{
AddressHighlightProvider
}
from
'
lib/contexts/addressHighlight
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
InternalTxsTableItem
from
'
./InternalTxsTableItem
'
;
import
InternalTxsTableItem
from
'
./InternalTxsTableItem
'
;
...
@@ -18,19 +17,19 @@ interface Props {
...
@@ -18,19 +17,19 @@ interface Props {
const
InternalTxsTable
=
({
data
,
currentAddress
,
isLoading
}:
Props
)
=>
{
const
InternalTxsTable
=
({
data
,
currentAddress
,
isLoading
}:
Props
)
=>
{
return
(
return
(
<
AddressHighlightProvider
>
<
AddressHighlightProvider
>
<
Table
>
<
Table
Root
>
<
T
head
top=
{
68
}
>
<
T
ableHeaderSticky
top=
{
68
}
>
<
T
r
>
<
T
ableRow
>
<
T
h
width=
"15%"
>
Parent txn hash
</
Th
>
<
T
ableColumnHeader
width=
"15%"
>
Parent txn hash
</
TableColumnHeader
>
<
T
h
width=
"15%"
>
Type
</
Th
>
<
T
ableColumnHeader
width=
"15%"
>
Type
</
TableColumnHeader
>
<
T
h
width=
"10%"
>
Block
</
Th
>
<
T
ableColumnHeader
width=
"10%"
>
Block
</
TableColumnHeader
>
<
T
h
width=
"40%"
>
From/To
</
Th
>
<
T
ableColumnHeader
width=
"40%"
>
From/To
</
TableColumnHeader
>
<
T
h
width=
"20%"
isNumeric
>
<
T
ableColumnHeader
width=
"20%"
isNumeric
>
Value
{
currencyUnits
.
ether
}
Value
{
currencyUnits
.
ether
}
</
T
h
>
</
T
ableColumnHeader
>
</
T
r
>
</
T
ableRow
>
</
T
head
>
</
T
ableHeaderSticky
>
<
T
b
ody
>
<
T
ableB
ody
>
{
data
.
map
((
item
,
index
)
=>
(
{
data
.
map
((
item
,
index
)
=>
(
<
InternalTxsTableItem
<
InternalTxsTableItem
key=
{
item
.
transaction_hash
+
'
_
'
+
index
}
key=
{
item
.
transaction_hash
+
'
_
'
+
index
}
...
@@ -39,8 +38,8 @@ const InternalTxsTable = ({ data, currentAddress, isLoading }: Props) => {
...
@@ -39,8 +38,8 @@ const InternalTxsTable = ({ data, currentAddress, isLoading }: Props) => {
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
/>
/>
))
}
))
}
</
T
b
ody
>
</
T
ableB
ody
>
</
Table
>
</
Table
Root
>
</
AddressHighlightProvider
>
</
AddressHighlightProvider
>
);
);
...
...
ui/internalTxs/InternalTxsTableItem.tsx
View file @
ba2a3e2e
import
{
Tr
,
Td
,
Box
,
Flex
}
from
'
@chakra-ui/react
'
;
import
{
Flex
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
InternalTransaction
}
from
'
types/api/internalTransaction
'
;
import
type
{
InternalTransaction
}
from
'
types/api/internalTransaction
'
;
import
config
from
'
configs/app
'
;
import
config
from
'
configs/app
'
;
import
{
Badge
}
from
'
toolkit/chakra/badge
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
TxStatus
from
'
ui/shared/statusTag/TxStatus
'
;
import
TxStatus
from
'
ui/shared/statusTag/TxStatus
'
;
...
@@ -34,8 +35,8 @@ const InternalTxsTableItem = ({
...
@@ -34,8 +35,8 @@ const InternalTxsTableItem = ({
const
toData
=
to
?
to
:
createdContract
;
const
toData
=
to
?
to
:
createdContract
;
return
(
return
(
<
T
r
alignItems=
"top"
>
<
T
ableRow
alignItems=
"top"
>
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
Flex
rowGap=
{
3
}
flexDir=
"column"
>
<
Flex
rowGap=
{
3
}
flexDir=
"column"
>
<
TxEntity
<
TxEntity
hash=
{
txnHash
}
hash=
{
txnHash
}
...
@@ -53,41 +54,38 @@ const InternalTxsTableItem = ({
...
@@ -53,41 +54,38 @@ const InternalTxsTableItem = ({
fontSize=
"sm"
fontSize=
"sm"
/>
/>
</
Flex
>
</
Flex
>
</
T
d
>
</
T
ableCell
>
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
Flex
rowGap=
{
2
}
flexWrap=
"wrap
"
>
<
Flex
rowGap=
{
3
}
flexDir=
"column
"
>
{
typeTitle
&&
(
{
typeTitle
&&
(
<
Box
w=
"126px"
display=
"inline-block"
>
<
Badge
colorPalette=
"cyan"
loading=
{
isLoading
}
>
{
typeTitle
}
</
Badge
>
<
Tag
colorScheme=
"cyan"
mr=
{
5
}
isLoading=
{
isLoading
}
>
{
typeTitle
}
</
Tag
>
</
Box
>
)
}
)
}
<
TxStatus
status=
{
success
?
'
ok
'
:
'
error
'
}
errorText=
{
error
}
isLoading=
{
isLoading
}
/>
<
TxStatus
status=
{
success
?
'
ok
'
:
'
error
'
}
errorText=
{
error
}
isLoading=
{
isLoading
}
/>
</
Flex
>
</
Flex
>
</
T
d
>
</
T
ableCell
>
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
BlockEntity
<
BlockEntity
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
number=
{
blockNumber
}
number=
{
blockNumber
}
noIcon
noIcon
fontSize=
"sm"
textStyle=
"sm"
lineHeight=
{
5
}
fontWeight=
{
500
}
fontWeight=
{
500
}
/>
/>
</
T
d
>
</
T
ableCell
>
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
AddressFromTo
<
AddressFromTo
from=
{
from
}
from=
{
from
}
to=
{
toData
}
to=
{
toData
}
current=
{
currentAddress
}
current=
{
currentAddress
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
/>
/>
</
T
d
>
</
T
ableCell
>
<
T
d
isNumeric
verticalAlign=
"middle"
>
<
T
ableCell
isNumeric
verticalAlign=
"middle"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
minW=
{
6
}
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
minW=
{
6
}
>
{
BigNumber
(
value
).
div
(
BigNumber
(
10
**
config
.
chain
.
currency
.
decimals
)).
toFormat
()
}
{
BigNumber
(
value
).
div
(
BigNumber
(
10
**
config
.
chain
.
currency
.
decimals
)).
toFormat
()
}
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
</
T
r
>
</
T
ableRow
>
);
);
};
};
...
...
ui/pages/Address.tsx
View file @
ba2a3e2e
...
@@ -201,12 +201,12 @@ const AddressPageContent = () => {
...
@@ -201,12 +201,12 @@ const AddressPageContent = () => {
component: <AddressTokens shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
component: <AddressTokens shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
subTabs: TOKEN_TABS,
subTabs: TOKEN_TABS,
},
},
//
{
{
//
id: 'internal_txns',
id: 'internal_txns',
//
title: 'Internal txns',
title: 'Internal txns',
//
count: addressTabsCountersQuery.data?.internal_transactions_count,
count: addressTabsCountersQuery.data?.internal_transactions_count,
//
component: <AddressInternalTxs scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
component: <AddressInternalTxs scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
//
},
},
addressTabsCountersQuery.data?.celo_election_rewards_count ? {
addressTabsCountersQuery.data?.celo_election_rewards_count ? {
id: 'epoch_rewards',
id: 'epoch_rewards',
title: 'Epoch rewards',
title: 'Epoch rewards',
...
...
ui/pages/InternalTxs.tsx
View file @
ba2a3e2e
import
{
Hide
,
Show
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
...
@@ -42,12 +42,12 @@ const InternalTxs = () => {
...
@@ -42,12 +42,12 @@ const InternalTxs = () => {
const
content
=
data
?.
items
?
(
const
content
=
data
?.
items
?
(
<>
<>
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Box
hideFrom=
"lg"
>
<
InternalTxsList
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
<
InternalTxsList
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
</
Show
>
</
Box
>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
InternalTxsTable
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
<
InternalTxsTable
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
</
Hide
>
</
Box
>
</>
</>
)
:
null
;
)
:
null
;
...
@@ -59,11 +59,12 @@ const InternalTxs = () => {
...
@@ -59,11 +59,12 @@ const InternalTxs = () => {
/>
/>
<
DataListDisplay
<
DataListDisplay
isError=
{
isError
}
isError=
{
isError
}
items
=
{
data
?.
items
}
items
Num=
{
data
?.
items
.
length
}
emptyText=
"There are no internal transactions."
emptyText=
"There are no internal transactions."
content=
{
content
}
actionBar=
{
actionBar
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
</>
</>
);
);
};
};
...
...
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