Commit 2b300205 authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

add timestamp to celo rewards view (#2361)

parent b126e6d6
...@@ -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,
}, },
......
...@@ -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: 1526, epoch_number: 1234,
associated_account: ADDRESS_PARAMS, associated_account: ADDRESS_PARAMS,
}; };
...@@ -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;
......
...@@ -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>
......
...@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment