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
4a55cf1a
Commit
4a55cf1a
authored
Feb 13, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
noves and celo tabs on address page
parent
4bf9bf5a
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
108 additions
and
102 deletions
+108
-102
select.recipe.ts
toolkit/theme/recipes/select.recipe.ts
+1
-1
AddressAccountHistory.tsx
ui/address/AddressAccountHistory.tsx
+24
-24
AddressAccountHistoryFilter.tsx
ui/address/AddressAccountHistoryFilter.tsx
+5
-2
AddressEpochRewards.tsx
ui/address/AddressEpochRewards.tsx
+9
-8
AddressAccountHistoryListItem.tsx
ui/address/accountHistory/AddressAccountHistoryListItem.tsx
+6
-6
AddressAccountHistoryTableItem.tsx
ui/address/accountHistory/AddressAccountHistoryTableItem.tsx
+15
-14
AddressEpochRewardsListItem.tsx
ui/address/epochRewards/AddressEpochRewardsListItem.tsx
+3
-3
AddressEpochRewardsTable.tsx
ui/address/epochRewards/AddressEpochRewardsTable.tsx
+13
-14
AddressEpochRewardsTableItem.tsx
ui/address/epochRewards/AddressEpochRewardsTableItem.tsx
+16
-15
Address.tsx
ui/pages/Address.tsx
+13
-13
EpochRewardTypeTag.tsx
ui/shared/EpochRewardTypeTag.tsx
+3
-2
No files found.
toolkit/theme/recipes/select.recipe.ts
View file @
4a55cf1a
...
@@ -55,7 +55,7 @@ export const recipe = defineSlotRecipe({
...
@@ -55,7 +55,7 @@ export const recipe = defineSlotRecipe({
background
:
'
popover.bg
'
,
background
:
'
popover.bg
'
,
display
:
'
flex
'
,
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
flexDirection
:
'
column
'
,
zIndex
:
'
dropdown
'
,
zIndex
:
'
popover
'
,
borderRadius
:
'
md
'
,
borderRadius
:
'
md
'
,
borderWidth
:
'
0
'
,
borderWidth
:
'
0
'
,
outline
:
0
,
outline
:
0
,
...
...
ui/address/AddressAccountHistory.tsx
View file @
4a55cf1a
import
{
Box
,
Hide
,
Show
,
Table
,
import
{
Box
}
from
'
@chakra-ui/react
'
;
Tbody
,
Th
,
Tr
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -11,13 +10,13 @@ import useIsMounted from 'lib/hooks/useIsMounted';
...
@@ -11,13 +10,13 @@ import useIsMounted from 'lib/hooks/useIsMounted';
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
{
NOVES_TRANSLATE
}
from
'
stubs/noves/NovesTranslate
'
;
import
{
NOVES_TRANSLATE
}
from
'
stubs/noves/NovesTranslate
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
AddressAccountHistoryTableItem
from
'
ui/address/accountHistory/AddressAccountHistoryTableItem
'
;
import
AddressAccountHistoryTableItem
from
'
ui/address/accountHistory/AddressAccountHistoryTableItem
'
;
import
ActionBar
from
'
ui/shared/ActionBar
'
;
import
ActionBar
from
'
ui/shared/ActionBar
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
{
getFromToValue
}
from
'
ui/shared/Noves/utils
'
;
import
{
getFromToValue
}
from
'
ui/shared/Noves/utils
'
;
import
Pagination
from
'
ui/shared/pagination/Pagination
'
;
import
Pagination
from
'
ui/shared/pagination/Pagination
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
TheadSticky
from
'
ui/shared/TheadSticky
'
;
import
AddressAccountHistoryListItem
from
'
./accountHistory/AddressAccountHistoryListItem
'
;
import
AddressAccountHistoryListItem
from
'
./accountHistory/AddressAccountHistoryListItem
'
;
import
AccountHistoryFilter
from
'
./AddressAccountHistoryFilter
'
;
import
AccountHistoryFilter
from
'
./AddressAccountHistoryFilter
'
;
...
@@ -75,7 +74,7 @@ const AddressAccountHistory = ({ scrollRef, shouldRender = true, isQueryEnabled
...
@@ -75,7 +74,7 @@ const AddressAccountHistory = ({ scrollRef, shouldRender = true, isQueryEnabled
const
content
=
(
const
content
=
(
<
Box
position=
"relative"
>
<
Box
position=
"relative"
>
<
Hide
above=
"lg"
ssr=
{
false
}
>
<
Box
hideFrom=
"lg"
>
{
filteredData
?.
map
((
item
,
i
)
=>
(
{
filteredData
?.
map
((
item
,
i
)
=>
(
<
AddressAccountHistoryListItem
<
AddressAccountHistoryListItem
key=
{
`${ i }-${ item.rawTransactionData.transactionHash }`
}
key=
{
`${ i }-${ item.rawTransactionData.transactionHash }`
}
...
@@ -84,24 +83,24 @@ const AddressAccountHistory = ({ scrollRef, shouldRender = true, isQueryEnabled
...
@@ -84,24 +83,24 @@ const AddressAccountHistory = ({ scrollRef, shouldRender = true, isQueryEnabled
isPlaceholderData=
{
isPlaceholderData
}
isPlaceholderData=
{
isPlaceholderData
}
/>
/>
))
}
))
}
</
Hide
>
</
Box
>
<
Show
above=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
Table
>
<
Table
Root
>
<
T
head
Sticky
top=
{
75
}
>
<
T
ableHeader
Sticky
top=
{
75
}
>
<
T
r
>
<
T
ableRow
>
<
T
h
width=
"120px"
>
<
T
ableColumnHeader
width=
"120px"
>
Age
Age
</
T
h
>
</
T
ableColumnHeader
>
<
T
h
>
<
T
ableColumnHeader
>
Action
Action
</
T
h
>
</
T
ableColumnHeader
>
<
T
h
width=
"320px"
>
<
T
ableColumnHeader
width=
"320px"
>
From/To
From/To
</
T
h
>
</
T
ableColumnHeader
>
</
T
r
>
</
T
ableRow
>
</
T
head
Sticky
>
</
T
ableHeader
Sticky
>
<
T
b
ody
maxWidth=
"full"
>
<
T
ableB
ody
maxWidth=
"full"
>
{
filteredData
?.
map
((
item
,
i
)
=>
(
{
filteredData
?.
map
((
item
,
i
)
=>
(
<
AddressAccountHistoryTableItem
<
AddressAccountHistoryTableItem
key=
{
`${ i }-${ item.rawTransactionData.transactionHash }`
}
key=
{
`${ i }-${ item.rawTransactionData.transactionHash }`
}
...
@@ -110,24 +109,25 @@ const AddressAccountHistory = ({ scrollRef, shouldRender = true, isQueryEnabled
...
@@ -110,24 +109,25 @@ const AddressAccountHistory = ({ scrollRef, shouldRender = true, isQueryEnabled
isPlaceholderData=
{
isPlaceholderData
}
isPlaceholderData=
{
isPlaceholderData
}
/>
/>
))
}
))
}
</
T
b
ody
>
</
T
ableB
ody
>
</
Table
>
</
Table
Root
>
</
Show
>
</
Box
>
</
Box
>
</
Box
>
);
);
return
(
return
(
<
DataListDisplay
<
DataListDisplay
isError=
{
isError
}
isError=
{
isError
}
items
=
{
filteredData
}
items
Num=
{
filteredData
?.
length
}
emptyText=
"There are no transactions."
emptyText=
"There are no transactions."
content=
{
content
}
actionBar=
{
actionBar
}
actionBar=
{
actionBar
}
filterProps=
{
{
filterProps=
{
{
hasActiveFilters
:
Boolean
(
filterValue
),
hasActiveFilters
:
Boolean
(
filterValue
),
emptyFilteredText
:
'
No match found for current filter
'
,
emptyFilteredText
:
'
No match found for current filter
'
,
}
}
}
}
/>
>
{
content
}
</
DataListDisplay
>
);
);
};
};
...
...
ui/address/AddressAccountHistoryFilter.tsx
View file @
4a55cf1a
import
{
createListCollection
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
NovesHistoryFilterValue
}
from
'
types/api/noves
'
;
import
type
{
NovesHistoryFilterValue
}
from
'
types/api/noves
'
;
...
@@ -11,6 +12,8 @@ const OPTIONS = [
...
@@ -11,6 +12,8 @@ const OPTIONS = [
{
value
:
'
sent
'
,
label
:
'
Sent to
'
},
{
value
:
'
sent
'
,
label
:
'
Sent to
'
},
];
];
const
collection
=
createListCollection
({
items
:
OPTIONS
});
interface
Props
{
interface
Props
{
hasActiveFilter
:
boolean
;
hasActiveFilter
:
boolean
;
defaultFilter
:
NovesHistoryFilterValue
;
defaultFilter
:
NovesHistoryFilterValue
;
...
@@ -24,11 +27,11 @@ const AccountHistoryFilter = ({ onFilterChange, defaultFilter, hasActiveFilter,
...
@@ -24,11 +27,11 @@ const AccountHistoryFilter = ({ onFilterChange, defaultFilter, hasActiveFilter,
return
(
return
(
<
PopoverFilterRadio
<
PopoverFilterRadio
name=
"account_history_filter"
name=
"account_history_filter"
options=
{
OPTIONS
}
collection=
{
collection
}
onChange=
{
onFilterChange
}
onChange=
{
onFilterChange
}
hasActiveFilter=
{
hasActiveFilter
}
hasActiveFilter=
{
hasActiveFilter
}
isLoading=
{
isInitialLoading
}
isLoading=
{
isInitialLoading
}
default
Value=
{
defaultFilter
||
OPTIONS
[
0
].
value
}
initial
Value=
{
defaultFilter
||
OPTIONS
[
0
].
value
}
/>
/>
);
);
};
};
...
...
ui/address/AddressEpochRewards.tsx
View file @
4a55cf1a
import
{
Hide
,
Show
}
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
'
;
...
@@ -51,14 +51,14 @@ const AddressEpochRewards = ({ scrollRef, shouldRender = true, isQueryEnabled =
...
@@ -51,14 +51,14 @@ const AddressEpochRewards = ({ scrollRef, shouldRender = true, isQueryEnabled =
const
content
=
rewardsQuery
.
data
?.
items
?
(
const
content
=
rewardsQuery
.
data
?.
items
?
(
<>
<>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
Box
hideBelow=
"lg"
>
<
AddressEpochRewardsTable
<
AddressEpochRewardsTable
items=
{
rewardsQuery
.
data
.
items
}
items=
{
rewardsQuery
.
data
.
items
}
top=
{
rewardsQuery
.
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
top=
{
rewardsQuery
.
pagination
.
isVisible
?
ACTION_BAR_HEIGHT_DESKTOP
:
0
}
isLoading=
{
rewardsQuery
.
isPlaceholderData
}
isLoading=
{
rewardsQuery
.
isPlaceholderData
}
/>
/>
</
Hide
>
</
Box
>
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Box
hideFrom=
"lg"
>
{
rewardsQuery
.
data
.
items
.
map
((
item
,
index
)
=>
(
{
rewardsQuery
.
data
.
items
.
map
((
item
,
index
)
=>
(
<
AddressEpochRewardsListItem
<
AddressEpochRewardsListItem
key=
{
item
.
block_hash
+
item
.
type
+
item
.
account
.
hash
+
item
.
associated_account
.
hash
+
(
rewardsQuery
.
isPlaceholderData
?
String
(
index
)
:
''
)
}
key=
{
item
.
block_hash
+
item
.
type
+
item
.
account
.
hash
+
item
.
associated_account
.
hash
+
(
rewardsQuery
.
isPlaceholderData
?
String
(
index
)
:
''
)
}
...
@@ -66,7 +66,7 @@ const AddressEpochRewards = ({ scrollRef, shouldRender = true, isQueryEnabled =
...
@@ -66,7 +66,7 @@ const AddressEpochRewards = ({ scrollRef, shouldRender = true, isQueryEnabled =
isLoading=
{
rewardsQuery
.
isPlaceholderData
}
isLoading=
{
rewardsQuery
.
isPlaceholderData
}
/>
/>
))
}
))
}
</
Show
>
</
Box
>
</>
</>
)
:
null
;
)
:
null
;
...
@@ -85,11 +85,12 @@ const AddressEpochRewards = ({ scrollRef, shouldRender = true, isQueryEnabled =
...
@@ -85,11 +85,12 @@ const AddressEpochRewards = ({ scrollRef, shouldRender = true, isQueryEnabled =
return
(
return
(
<
DataListDisplay
<
DataListDisplay
isError=
{
rewardsQuery
.
isError
}
isError=
{
rewardsQuery
.
isError
}
items
=
{
rewardsQuery
.
data
?.
items
}
items
Num=
{
rewardsQuery
.
data
?.
items
?.
length
}
emptyText=
"There are no epoch rewards for this address."
emptyText=
"There are no epoch rewards for this address."
content=
{
content
}
actionBar=
{
actionBar
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
);
);
};
};
...
...
ui/address/accountHistory/AddressAccountHistoryListItem.tsx
View file @
4a55cf1a
...
@@ -3,9 +3,9 @@ import React, { useMemo } from 'react';
...
@@ -3,9 +3,9 @@ import React, { useMemo } from 'react';
import
type
{
NovesResponseData
}
from
'
types/api/noves
'
;
import
type
{
NovesResponseData
}
from
'
types/api/noves
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
LinkInternal
from
'
ui/shared/links/LinkInternal
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
import
NovesFromTo
from
'
ui/shared/Noves/NovesFromTo
'
;
import
NovesFromTo
from
'
ui/shared/Noves/NovesFromTo
'
;
import
TimeAgoWithTooltip
from
'
ui/shared/TimeAgoWithTooltip
'
;
import
TimeAgoWithTooltip
from
'
ui/shared/TimeAgoWithTooltip
'
;
...
@@ -26,7 +26,7 @@ const AddressAccountHistoryListItem = (props: Props) => {
...
@@ -26,7 +26,7 @@ const AddressAccountHistoryListItem = (props: Props) => {
return
(
return
(
<
ListItemMobile
rowGap=
{
4
}
w=
"full"
>
<
ListItemMobile
rowGap=
{
4
}
w=
"full"
>
<
Skeleton
borderRadius=
"sm"
isLoaded=
{
!
props
.
isPlaceholderData
}
w=
"full"
>
<
Skeleton
borderRadius=
"sm"
loading=
{
props
.
isPlaceholderData
}
w=
"full"
>
<
Flex
justifyContent=
"space-between"
w=
"full"
>
<
Flex
justifyContent=
"space-between"
w=
"full"
>
<
Flex
columnGap=
{
2
}
>
<
Flex
columnGap=
{
2
}
>
<
IconSvg
<
IconSvg
...
@@ -49,15 +49,15 @@ const AddressAccountHistoryListItem = (props: Props) => {
...
@@ -49,15 +49,15 @@ const AddressAccountHistoryListItem = (props: Props) => {
/>
/>
</
Flex
>
</
Flex
>
</
Skeleton
>
</
Skeleton
>
<
Skeleton
borderRadius=
"sm"
isLoaded=
{
!
props
.
isPlaceholderData
}
>
<
Skeleton
borderRadius=
"sm"
loading=
{
props
.
isPlaceholderData
}
>
<
Link
Internal
<
Link
href=
{
`/tx/${ props.tx.rawTransactionData.transactionHash }`
}
href=
{
`/tx/${ props.tx.rawTransactionData.transactionHash }`
}
fontWeight=
"bold"
fontWeight=
"bold"
whiteSpace=
"break-spaces"
whiteSpace=
"break-spaces"
wordBreak=
"break-word"
wordBreak=
"break-word"
>
>
{
parsedDescription
}
{
parsedDescription
}
</
Link
Internal
>
</
Link
>
</
Skeleton
>
</
Skeleton
>
<
Box
maxW=
"full"
>
<
Box
maxW=
"full"
>
...
...
ui/address/accountHistory/AddressAccountHistoryTableItem.tsx
View file @
4a55cf1a
import
{
Td
,
Tr
,
Box
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
React
,
{
useMemo
}
from
'
react
'
;
import
React
,
{
useMemo
}
from
'
react
'
;
import
type
{
NovesResponseData
}
from
'
types/api/noves
'
;
import
type
{
NovesResponseData
}
from
'
types/api/noves
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
{
Link
}
from
'
toolkit/chakra/link
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
LinkInternal
from
'
ui/shared/links/LinkInternal
'
;
import
NovesFromTo
from
'
ui/shared/Noves/NovesFromTo
'
;
import
NovesFromTo
from
'
ui/shared/Noves/NovesFromTo
'
;
import
TimeAgoWithTooltip
from
'
ui/shared/TimeAgoWithTooltip
'
;
import
TimeAgoWithTooltip
from
'
ui/shared/TimeAgoWithTooltip
'
;
...
@@ -24,8 +25,8 @@ const AddressAccountHistoryTableItem = (props: Props) => {
...
@@ -24,8 +25,8 @@ const AddressAccountHistoryTableItem = (props: Props) => {
},
[
props
.
tx
.
classificationData
.
description
]);
},
[
props
.
tx
.
classificationData
.
description
]);
return
(
return
(
<
T
r
>
<
T
ableRow
>
<
T
d
px=
{
3
}
py=
"18px"
fontSize=
"sm"
>
<
T
ableCell
px=
{
3
}
py=
"18px"
fontSize=
"sm"
>
<
TimeAgoWithTooltip
<
TimeAgoWithTooltip
timestamp=
{
props
.
tx
.
rawTransactionData
.
timestamp
*
1000
}
timestamp=
{
props
.
tx
.
rawTransactionData
.
timestamp
*
1000
}
isLoading=
{
props
.
isPlaceholderData
}
isLoading=
{
props
.
isPlaceholderData
}
...
@@ -33,9 +34,9 @@ const AddressAccountHistoryTableItem = (props: Props) => {
...
@@ -33,9 +34,9 @@ const AddressAccountHistoryTableItem = (props: Props) => {
borderRadius=
"sm"
borderRadius=
"sm"
flexShrink=
{
0
}
flexShrink=
{
0
}
/>
/>
</
T
d
>
</
T
ableCell
>
<
T
d
px=
{
3
}
py=
"18px"
fontSize=
"sm"
>
<
T
ableCell
px=
{
3
}
py=
"18px"
fontSize=
"sm"
>
<
Skeleton
borderRadius=
"sm"
isLoaded=
{
!
props
.
isPlaceholderData
}
>
<
Skeleton
borderRadius=
"sm"
loading=
{
props
.
isPlaceholderData
}
>
<
Box
display=
"flex"
>
<
Box
display=
"flex"
>
<
IconSvg
<
IconSvg
name=
"lightning"
name=
"lightning"
...
@@ -46,23 +47,23 @@ const AddressAccountHistoryTableItem = (props: Props) => {
...
@@ -46,23 +47,23 @@ const AddressAccountHistoryTableItem = (props: Props) => {
_dark=
{
{
color
:
'
gray.400
'
}
}
_dark=
{
{
color
:
'
gray.400
'
}
}
/>
/>
<
Link
Internal
<
Link
href=
{
`/tx/${ props.tx.rawTransactionData.transactionHash }`
}
href=
{
`/tx/${ props.tx.rawTransactionData.transactionHash }`
}
fontWeight=
"bold"
fontWeight=
"bold"
whiteSpace=
"break-spaces"
whiteSpace=
"break-spaces"
wordBreak=
"break-word"
wordBreak=
"break-word"
>
>
{
parsedDescription
}
{
parsedDescription
}
</
Link
Internal
>
</
Link
>
</
Box
>
</
Box
>
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
<
T
d
px=
{
3
}
py=
"18px"
fontSize=
"sm"
>
<
T
ableCell
px=
{
3
}
py=
"18px"
fontSize=
"sm"
>
<
Box
flexShrink=
{
0
}
>
<
Box
flexShrink=
{
0
}
>
<
NovesFromTo
txData=
{
props
.
tx
}
currentAddress=
{
props
.
currentAddress
}
isLoaded=
{
!
props
.
isPlaceholderData
}
/>
<
NovesFromTo
txData=
{
props
.
tx
}
currentAddress=
{
props
.
currentAddress
}
isLoaded=
{
!
props
.
isPlaceholderData
}
/>
</
Box
>
</
Box
>
</
T
d
>
</
T
ableCell
>
</
T
r
>
</
T
ableRow
>
);
);
};
};
...
...
ui/address/epochRewards/AddressEpochRewardsListItem.tsx
View file @
4a55cf1a
...
@@ -3,7 +3,7 @@ import React from 'react';
...
@@ -3,7 +3,7 @@ import React from 'react';
import
type
{
AddressEpochRewardsItem
}
from
'
types/api/address
'
;
import
type
{
AddressEpochRewardsItem
}
from
'
types/api/address
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
Skeleton
from
'
ui/shared/chakra/S
keleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/s
keleton
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
...
@@ -32,7 +32,7 @@ const AddressEpochRewardsListItem = ({ item, isLoading }: Props) => {
...
@@ -32,7 +32,7 @@ const AddressEpochRewardsListItem = ({ item, isLoading }: Props) => {
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Epoch #
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Epoch #
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Value
>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
<
Skeleton
loading=
{
isLoading
}
>
{
item
.
epoch_number
}
{
item
.
epoch_number
}
</
Skeleton
>
</
Skeleton
>
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
...
@@ -62,7 +62,7 @@ const AddressEpochRewardsListItem = ({ item, isLoading }: Props) => {
...
@@ -62,7 +62,7 @@ const AddressEpochRewardsListItem = ({ item, isLoading }: Props) => {
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Value
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Value
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Value
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"flex"
alignItems=
"center"
gap=
{
2
}
>
<
Skeleton
loading=
{
isLoading
}
display=
"flex"
alignItems=
"center"
gap=
{
2
}
>
{
valueStr
}
{
valueStr
}
<
TokenEntity
token=
{
item
.
token
}
isLoading=
{
isLoading
}
onlySymbol
width=
"auto"
noCopy
/>
<
TokenEntity
token=
{
item
.
token
}
isLoading=
{
isLoading
}
onlySymbol
width=
"auto"
noCopy
/>
</
Skeleton
>
</
Skeleton
>
...
...
ui/address/epochRewards/AddressEpochRewardsTable.tsx
View file @
4a55cf1a
import
{
Table
,
Tbody
,
Th
,
Tr
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
AddressEpochRewardsItem
}
from
'
types/api/address
'
;
import
type
{
AddressEpochRewardsItem
}
from
'
types/api/address
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
AddressEpochRewardsTableItem
from
'
./AddressEpochRewardsTableItem
'
;
import
AddressEpochRewardsTableItem
from
'
./AddressEpochRewardsTableItem
'
;
...
@@ -15,16 +14,16 @@ import AddressEpochRewardsTableItem from './AddressEpochRewardsTableItem';
...
@@ -15,16 +14,16 @@ import AddressEpochRewardsTableItem from './AddressEpochRewardsTableItem';
const
AddressEpochRewardsTable
=
({
items
,
isLoading
,
top
}:
Props
)
=>
{
const
AddressEpochRewardsTable
=
({
items
,
isLoading
,
top
}:
Props
)
=>
{
return
(
return
(
<
Table
minW=
"1000px"
style=
{
{
tableLayout
:
'
auto
'
}
}
>
<
Table
Root
minW=
"1000px"
style=
{
{
tableLayout
:
'
auto
'
}
}
>
<
T
head
top=
{
top
}
>
<
T
ableHeaderSticky
top=
{
top
}
>
<
T
r
>
<
T
ableRow
>
<
T
h
>
Block
</
Th
>
<
T
ableColumnHeader
>
Block
</
TableColumnHeader
>
<
T
h
>
Reward type
</
Th
>
<
T
ableColumnHeader
>
Reward type
</
TableColumnHeader
>
<
T
h
>
Associated address
</
Th
>
<
T
ableColumnHeader
>
Associated address
</
TableColumnHeader
>
<
T
h
isNumeric
>
Value
</
Th
>
<
T
ableColumnHeader
isNumeric
>
Value
</
TableColumnHeader
>
</
T
r
>
</
T
ableRow
>
</
T
head
>
</
T
ableHeaderSticky
>
<
T
b
ody
>
<
T
ableB
ody
>
{
items
.
map
((
item
,
index
)
=>
{
{
items
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
AddressEpochRewardsTableItem
<
AddressEpochRewardsTableItem
...
@@ -34,8 +33,8 @@ const AddressEpochRewardsTable = ({ items, isLoading, top }: Props) => {
...
@@ -34,8 +33,8 @@ const AddressEpochRewardsTable = ({ items, isLoading, top }: Props) => {
/>
/>
);
);
})
}
})
}
</
T
b
ody
>
</
T
ableB
ody
>
</
Table
>
</
Table
Root
>
);
);
};
};
...
...
ui/address/epochRewards/AddressEpochRewardsTableItem.tsx
View file @
4a55cf1a
import
{
Flex
,
T
d
,
Tr
,
T
ext
}
from
'
@chakra-ui/react
'
;
import
{
Flex
,
Text
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
AddressEpochRewardsItem
}
from
'
types/api/address
'
;
import
type
{
AddressEpochRewardsItem
}
from
'
types/api/address
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
getCurrencyValue
from
'
lib/getCurrencyValue
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
AddressEntity
from
'
ui/shared/entities/address/AddressEntity
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
...
@@ -19,29 +20,29 @@ import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip';
...
@@ -19,29 +20,29 @@ import TimeAgoWithTooltip from 'ui/shared/TimeAgoWithTooltip';
const
AddressEpochRewardsTableItem
=
({
item
,
isLoading
}:
Props
)
=>
{
const
AddressEpochRewardsTableItem
=
({
item
,
isLoading
}:
Props
)
=>
{
const
{
valueStr
}
=
getCurrencyValue
({
value
:
item
.
amount
,
decimals
:
item
.
token
.
decimals
});
const
{
valueStr
}
=
getCurrencyValue
({
value
:
item
.
amount
,
decimals
:
item
.
token
.
decimals
});
return
(
return
(
<
T
r
>
<
T
ableRow
>
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
Flex
alignItems=
"center"
gap=
{
3
}
>
<
Flex
alignItems=
"center"
gap=
{
3
}
>
<
BlockEntity
number=
{
item
.
block_number
}
isLoading=
{
isLoading
}
noIcon
fontWeight=
{
600
}
/>
<
BlockEntity
number=
{
item
.
block_number
}
isLoading=
{
isLoading
}
noIcon
fontWeight=
{
600
}
/>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
<
Skeleton
loading=
{
isLoading
}
>
<
Text
color=
"text_secondary"
fontWeight=
{
600
}
>
{
`Epoch # ${ item.epoch_number }`
}
</
Text
>
<
Text
color=
"text_secondary"
fontWeight=
{
600
}
>
{
`Epoch # ${ item.epoch_number }`
}
</
Text
>
</
Skeleton
>
</
Skeleton
>
<
TimeAgoWithTooltip
timestamp=
{
item
.
block_timestamp
}
isLoading=
{
isLoading
}
textColor=
"text_
secondary"
fontWeight=
{
400
}
/>
<
TimeAgoWithTooltip
timestamp=
{
item
.
block_timestamp
}
isLoading=
{
isLoading
}
color=
"text.
secondary"
fontWeight=
{
400
}
/>
</
Flex
>
</
Flex
>
</
T
d
>
</
T
ableCell
>
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
EpochRewardTypeTag
type=
{
item
.
type
}
isLoading=
{
isLoading
}
/>
<
EpochRewardTypeTag
type=
{
item
.
type
}
isLoading=
{
isLoading
}
/>
</
T
d
>
</
T
ableCell
>
<
T
d
verticalAlign=
"middle"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
AddressEntity
address=
{
item
.
associated_account
}
isLoading=
{
isLoading
}
truncation=
"constant"
/>
<
AddressEntity
address=
{
item
.
associated_account
}
isLoading=
{
isLoading
}
truncation=
"constant"
/>
</
T
d
>
</
T
ableCell
>
<
T
d
verticalAlign=
"middle"
isNumeric
>
<
T
ableCell
verticalAlign=
"middle"
isNumeric
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"flex"
alignItems=
"center"
gap=
{
2
}
justifyContent=
"flex-end"
>
<
Skeleton
loading=
{
isLoading
}
display=
"flex"
alignItems=
"center"
gap=
{
2
}
justifyContent=
"flex-end"
>
{
valueStr
}
{
valueStr
}
<
TokenEntity
token=
{
item
.
token
}
isLoading=
{
isLoading
}
onlySymbol
width=
"auto"
noCopy
/>
<
TokenEntity
token=
{
item
.
token
}
isLoading=
{
isLoading
}
onlySymbol
width=
"auto"
noCopy
/>
</
Skeleton
>
</
Skeleton
>
</
T
d
>
</
T
ableCell
>
</
T
r
>
</
T
ableRow
>
);
);
};
};
...
...
ui/pages/Address.tsx
View file @
4a55cf1a
...
@@ -165,13 +165,13 @@ const AddressPageContent = () => {
...
@@ -165,13 +165,13 @@ const AddressPageContent = () => {
count: addressTabsCountersQuery.data?.transactions_count,
count: addressTabsCountersQuery.data?.transactions_count,
component: <AddressTxs scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
component: <AddressTxs scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
},
},
//
txInterpretation.isEnabled && txInterpretation.provider === 'noves' ?
txInterpretation.isEnabled && txInterpretation.provider === 'noves' ?
//
{
{
//
id: 'account_history',
id: 'account_history',
//
title: 'Account history',
title: 'Account history',
//
component: <AddressAccountHistory scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
component: <AddressAccountHistory scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
//
} :
} :
//
undefined,
undefined,
config.features.userOps.isEnabled && Boolean(userOpsAccountQuery.data?.total_ops) ?
config.features.userOps.isEnabled && Boolean(userOpsAccountQuery.data?.total_ops) ?
{
{
id: 'user_ops',
id: 'user_ops',
...
@@ -207,12 +207,12 @@ const AddressPageContent = () => {
...
@@ -207,12 +207,12 @@ const AddressPageContent = () => {
// 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',
//
count: addressTabsCountersQuery.data?.celo_election_rewards_count,
count: addressTabsCountersQuery.data?.celo_election_rewards_count,
//
component: <AddressEpochRewards scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
component: <AddressEpochRewards scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
//
} : undefined,
} : undefined,
{
{
id: 'coin_balance_history',
id: 'coin_balance_history',
title: 'Coin balance history',
title: 'Coin balance history',
...
...
ui/shared/EpochRewardTypeTag.tsx
View file @
4a55cf1a
...
@@ -2,6 +2,7 @@ import React from 'react';
...
@@ -2,6 +2,7 @@ import React from 'react';
import
type
{
EpochRewardsType
}
from
'
types/api/block
'
;
import
type
{
EpochRewardsType
}
from
'
types/api/block
'
;
import
type
{
BadgeProps
}
from
'
toolkit/chakra/badge
'
;
import
{
Badge
}
from
'
toolkit/chakra/badge
'
;
import
{
Badge
}
from
'
toolkit/chakra/badge
'
;
import
{
Tooltip
}
from
'
toolkit/chakra/tooltip
'
;
import
{
Tooltip
}
from
'
toolkit/chakra/tooltip
'
;
...
@@ -10,7 +11,7 @@ type Props = {
...
@@ -10,7 +11,7 @@ type Props = {
isLoading
?:
boolean
;
isLoading
?:
boolean
;
};
};
const
TYPE_TAGS
:
Record
<
EpochRewardsType
,
{
text
:
string
;
label
:
string
;
color
:
string
}
>
=
{
const
TYPE_TAGS
:
Record
<
EpochRewardsType
,
{
text
:
string
;
label
:
string
;
color
:
BadgeProps
[
'
colorPalette
'
]
}
>
=
{
group
:
{
group
:
{
text
:
'
Validator group rewards
'
,
text
:
'
Validator group rewards
'
,
// eslint-disable-next-line max-len
// eslint-disable-next-line max-len
...
@@ -40,7 +41,7 @@ const EpochRewardTypeTag = ({ type, isLoading }: Props) => {
...
@@ -40,7 +41,7 @@ const EpochRewardTypeTag = ({ type, isLoading }: Props) => {
return
(
return
(
<
Tooltip
content=
{
label
}
>
<
Tooltip
content=
{
label
}
>
<
Badge
color
Schem
e=
{
color
}
loading=
{
isLoading
}
>
<
Badge
color
Palett
e=
{
color
}
loading=
{
isLoading
}
>
{
text
}
{
text
}
</
Badge
>
</
Badge
>
</
Tooltip
>
</
Tooltip
>
...
...
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