Commit 4a55cf1a authored by tom's avatar tom

noves and celo tabs on address page

parent 4bf9bf5a
...@@ -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,
......
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> <TableRoot>
<TheadSticky top={ 75 }> <TableHeaderSticky top={ 75 }>
<Tr> <TableRow>
<Th width="120px"> <TableColumnHeader width="120px">
Age Age
</Th> </TableColumnHeader>
<Th> <TableColumnHeader>
Action Action
</Th> </TableColumnHeader>
<Th width="320px"> <TableColumnHeader width="320px">
From/To From/To
</Th> </TableColumnHeader>
</Tr> </TableRow>
</TheadSticky> </TableHeaderSticky>
<Tbody maxWidth="full"> <TableBody 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 }
/> />
)) } )) }
</Tbody> </TableBody>
</Table> </TableRoot>
</Show> </Box>
</Box> </Box>
); );
return ( return (
<DataListDisplay <DataListDisplay
isError={ isError } isError={ isError }
items={ filteredData } itemsNum={ 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>
); );
}; };
......
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 }
defaultValue={ defaultFilter || OPTIONS[0].value } initialValue={ defaultFilter || OPTIONS[0].value }
/> />
); );
}; };
......
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 } itemsNum={ 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>
); );
}; };
......
...@@ -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 }>
<LinkInternal <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 }
</LinkInternal> </Link>
</Skeleton> </Skeleton>
<Box maxW="full"> <Box maxW="full">
......
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 (
<Tr> <TableRow>
<Td px={ 3 } py="18px" fontSize="sm" > <TableCell 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 }
/> />
</Td> </TableCell>
<Td px={ 3 } py="18px" fontSize="sm" > <TableCell 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' }}
/> />
<LinkInternal <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 }
</LinkInternal> </Link>
</Box> </Box>
</Skeleton> </Skeleton>
</Td> </TableCell>
<Td px={ 3 } py="18px" fontSize="sm"> <TableCell 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>
</Td> </TableCell>
</Tr> </TableRow>
); );
}; };
......
...@@ -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/Skeleton'; import { Skeleton } from 'toolkit/chakra/skeleton';
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>
......
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' }}> <TableRoot minW="1000px" style={{ tableLayout: 'auto' }}>
<Thead top={ top }> <TableHeaderSticky top={ top }>
<Tr> <TableRow>
<Th>Block</Th> <TableColumnHeader>Block</TableColumnHeader>
<Th>Reward type</Th> <TableColumnHeader>Reward type</TableColumnHeader>
<Th>Associated address</Th> <TableColumnHeader>Associated address</TableColumnHeader>
<Th isNumeric>Value</Th> <TableColumnHeader isNumeric>Value</TableColumnHeader>
</Tr> </TableRow>
</Thead> </TableHeaderSticky>
<Tbody> <TableBody>
{ 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) => {
/> />
); );
}) } }) }
</Tbody> </TableBody>
</Table> </TableRoot>
); );
}; };
......
import { Flex, Td, Tr, Text } 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 (
<Tr> <TableRow>
<Td verticalAlign="middle"> <TableCell 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>
</Td> </TableCell>
<Td verticalAlign="middle"> <TableCell verticalAlign="middle">
<EpochRewardTypeTag type={ item.type } isLoading={ isLoading }/> <EpochRewardTypeTag type={ item.type } isLoading={ isLoading }/>
</Td> </TableCell>
<Td verticalAlign="middle"> <TableCell verticalAlign="middle">
<AddressEntity address={ item.associated_account } isLoading={ isLoading } truncation="constant"/> <AddressEntity address={ item.associated_account } isLoading={ isLoading } truncation="constant"/>
</Td> </TableCell>
<Td verticalAlign="middle" isNumeric> <TableCell 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>
</Td> </TableCell>
</Tr> </TableRow>
); );
}; };
......
...@@ -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',
......
...@@ -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 colorScheme={ color } loading={ isLoading }> <Badge colorPalette={ color } loading={ isLoading }>
{ text } { text }
</Badge> </Badge>
</Tooltip> </Tooltip>
......
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