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
2b300205
Unverified
Commit
2b300205
authored
Nov 06, 2024
by
Igor Stuev
Committed by
GitHub
Nov 06, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add timestamp to celo rewards view (#2361)
parent
b126e6d6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
9 deletions
+19
-9
epochRewards.ts
mocks/address/epochRewards.ts
+3
-0
address.ts
stubs/address.ts
+2
-1
address.ts
types/api/address.ts
+1
-0
AddressEpochRewards.pw.tsx_default_base-view-mobile-1.png
...AddressEpochRewards.pw.tsx_default_base-view-mobile-1.png
+0
-0
AddressEpochRewards.pw.tsx_mobile_base-view-mobile-1.png
.../AddressEpochRewards.pw.tsx_mobile_base-view-mobile-1.png
+0
-0
AddressEpochRewardsListItem.tsx
ui/address/epochRewards/AddressEpochRewardsListItem.tsx
+7
-4
AddressEpochRewardsTableItem.tsx
ui/address/epochRewards/AddressEpochRewardsTableItem.tsx
+6
-4
No files found.
mocks/address/epochRewards.ts
View file @
2b300205
...
@@ -13,6 +13,7 @@ export const epochRewards: AddressEpochRewardsResponse = {
...
@@ -13,6 +13,7 @@ export const epochRewards: AddressEpochRewardsResponse = {
associated_account
:
withName
,
associated_account
:
withName
,
block_hash
:
'
0x
'
,
block_hash
:
'
0x
'
,
block_number
:
26369280
,
block_number
:
26369280
,
block_timestamp
:
'
2022-05-15T13:16:24Z
'
,
epoch_number
:
1526
,
epoch_number
:
1526
,
token
:
tokenInfo
,
token
:
tokenInfo
,
},
},
...
@@ -23,6 +24,7 @@ export const epochRewards: AddressEpochRewardsResponse = {
...
@@ -23,6 +24,7 @@ export const epochRewards: AddressEpochRewardsResponse = {
associated_account
:
withoutName
,
associated_account
:
withoutName
,
block_hash
:
'
0x
'
,
block_hash
:
'
0x
'
,
block_number
:
26352000
,
block_number
:
26352000
,
block_timestamp
:
'
2022-05-15T13:16:24Z
'
,
epoch_number
:
1525
,
epoch_number
:
1525
,
token
:
tokenInfo
,
token
:
tokenInfo
,
},
},
...
@@ -33,6 +35,7 @@ export const epochRewards: AddressEpochRewardsResponse = {
...
@@ -33,6 +35,7 @@ export const epochRewards: AddressEpochRewardsResponse = {
associated_account
:
withEns
,
associated_account
:
withEns
,
block_hash
:
'
0x
'
,
block_hash
:
'
0x
'
,
block_number
:
26300160
,
block_number
:
26300160
,
block_timestamp
:
'
2022-05-15T13:16:24Z
'
,
epoch_number
:
1524
,
epoch_number
:
1524
,
token
:
tokenInfo
,
token
:
tokenInfo
,
},
},
...
...
stubs/address.ts
View file @
2b300205
...
@@ -121,10 +121,11 @@ export const ADDRESS_MUD_TABLE_ITEM: AddressMudTableItem = {
...
@@ -121,10 +121,11 @@ export const ADDRESS_MUD_TABLE_ITEM: AddressMudTableItem = {
export
const
EPOCH_REWARD_ITEM
:
AddressEpochRewardsItem
=
{
export
const
EPOCH_REWARD_ITEM
:
AddressEpochRewardsItem
=
{
amount
:
'
136609473658452408568
'
,
amount
:
'
136609473658452408568
'
,
block_number
:
10355938
,
block_number
:
10355938
,
block_timestamp
:
'
2022-05-15T13:16:24Z
'
,
type
:
'
voter
'
,
type
:
'
voter
'
,
token
:
TOKEN_INFO_ERC_20
,
token
:
TOKEN_INFO_ERC_20
,
block_hash
:
'
0x5956a847d8089e254e02e5111cad6992b99ceb9e5c2dc4343fd53002834c4dc6
'
,
block_hash
:
'
0x5956a847d8089e254e02e5111cad6992b99ceb9e5c2dc4343fd53002834c4dc6
'
,
account
:
ADDRESS_PARAMS
,
account
:
ADDRESS_PARAMS
,
epoch_number
:
1
526
,
epoch_number
:
1
234
,
associated_account
:
ADDRESS_PARAMS
,
associated_account
:
ADDRESS_PARAMS
,
};
};
types/api/address.ts
View file @
2b300205
...
@@ -266,6 +266,7 @@ export type AddressEpochRewardsItem = {
...
@@ -266,6 +266,7 @@ export type AddressEpochRewardsItem = {
amount
:
string
;
amount
:
string
;
block_number
:
number
;
block_number
:
number
;
block_hash
:
string
;
block_hash
:
string
;
block_timestamp
:
string
;
account
:
AddressParam
;
account
:
AddressParam
;
epoch_number
:
number
;
epoch_number
:
number
;
associated_account
:
AddressParam
;
associated_account
:
AddressParam
;
...
...
ui/address/__screenshots__/AddressEpochRewards.pw.tsx_default_base-view-mobile-1.png
View replaced file @
b126e6d6
View file @
2b300205
36.1 KB
|
W:
|
H:
39.5 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/address/__screenshots__/AddressEpochRewards.pw.tsx_mobile_base-view-mobile-1.png
View replaced file @
b126e6d6
View file @
2b300205
44.4 KB
|
W:
|
H:
49.9 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/address/epochRewards/AddressEpochRewardsListItem.tsx
View file @
2b300205
...
@@ -9,6 +9,7 @@ import BlockEntity from 'ui/shared/entities/block/BlockEntity';
...
@@ -9,6 +9,7 @@ import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
TokenEntity
from
'
ui/shared/entities/token/TokenEntity
'
;
import
EpochRewardTypeTag
from
'
ui/shared/EpochRewardTypeTag
'
;
import
EpochRewardTypeTag
from
'
ui/shared/EpochRewardTypeTag
'
;
import
ListItemMobileGrid
from
'
ui/shared/ListItemMobile/ListItemMobileGrid
'
;
import
ListItemMobileGrid
from
'
ui/shared/ListItemMobile/ListItemMobileGrid
'
;
import
TimeAgoWithTooltip
from
'
ui/shared/TimeAgoWithTooltip
'
;
type
Props
=
{
type
Props
=
{
item
:
AddressEpochRewardsItem
;
item
:
AddressEpochRewardsItem
;
...
@@ -31,18 +32,20 @@ const AddressEpochRewardsListItem = ({ item, isLoading }: Props) => {
...
@@ -31,18 +32,20 @@ const AddressEpochRewardsListItem = ({ item, isLoading }: Props) => {
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Epoch #
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Epoch #
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Value
>
{
item
.
epoch_number
}
<
Skeleton
isLoaded=
{
!
isLoading
}
>
{
item
.
epoch_number
}
</
Skeleton
>
</
ListItemMobileGrid
.
Value
>
</
ListItemMobileGrid
.
Value
>
{
/*
<ListItemMobileGrid.Label isLoading={ isLoading }>Age</ListItemMobileGrid.Label>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Age
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Value
>
<
TimeAgoWithTooltip
<
TimeAgoWithTooltip
timestamp={ item.timestamp }
timestamp=
{
item
.
block_
timestamp
}
isLoading=
{
isLoading
}
isLoading=
{
isLoading
}
color=
"text_secondary"
color=
"text_secondary"
display=
"inline-block"
display=
"inline-block"
/>
/>
</ListItemMobileGrid.Value>
*/
}
</
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Reward type
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Label
isLoading=
{
isLoading
}
>
Reward type
</
ListItemMobileGrid
.
Label
>
<
ListItemMobileGrid
.
Value
>
<
ListItemMobileGrid
.
Value
>
...
...
ui/address/epochRewards/AddressEpochRewardsTableItem.tsx
View file @
2b300205
...
@@ -8,6 +8,7 @@ import AddressEntity from 'ui/shared/entities/address/AddressEntity';
...
@@ -8,6 +8,7 @@ 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
'
;
import
EpochRewardTypeTag
from
'
ui/shared/EpochRewardTypeTag
'
;
import
EpochRewardTypeTag
from
'
ui/shared/EpochRewardTypeTag
'
;
import
TimeAgoWithTooltip
from
'
ui/shared/TimeAgoWithTooltip
'
;
type
Props
=
{
type
Props
=
{
item
:
AddressEpochRewardsItem
;
item
:
AddressEpochRewardsItem
;
...
@@ -20,10 +21,11 @@ const AddressEpochRewardsTableItem = ({ item, isLoading }: Props) => {
...
@@ -20,10 +21,11 @@ const AddressEpochRewardsTableItem = ({ item, isLoading }: Props) => {
<
Tr
>
<
Tr
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
<
Flex
alignItems=
"center"
gap=
{
3
}
>
<
Flex
alignItems=
"center"
gap=
{
3
}
>
<
BlockEntity
number=
{
item
.
block_number
}
isLoading=
{
isLoading
}
noIcon
/>
<
BlockEntity
number=
{
item
.
block_number
}
isLoading=
{
isLoading
}
noIcon
fontWeight=
{
600
}
/>
<
Text
color=
"text_secondary"
fontWeight=
{
600
}
>
{
`Epoch # ${ item.epoch_number }`
}
</
Text
>
<
Skeleton
isLoaded=
{
!
isLoading
}
>
{
/* no timestamp from API, will be added later */
}
<
Text
color=
"text_secondary"
fontWeight=
{
600
}
>
{
`Epoch # ${ item.epoch_number }`
}
</
Text
>
{
/* <TimeAgoWithTooltip timestamp={ item } isLoading={ isLoading }/> */
}
</
Skeleton
>
<
TimeAgoWithTooltip
timestamp=
{
item
.
block_timestamp
}
isLoading=
{
isLoading
}
textColor=
"text_secondary"
fontWeight=
{
400
}
/>
</
Flex
>
</
Flex
>
</
Td
>
</
Td
>
<
Td
verticalAlign=
"middle"
>
<
Td
verticalAlign=
"middle"
>
...
...
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