Fixed update date for top charts tip

pull/232/head
artemkolodko 2 years ago
parent 76a311a973
commit 68f8a68d66
  1. 7
      src/pages/TopStatsPage/Transaction.tsx

@ -73,7 +73,8 @@ export const TransactionTopStats = () => {
}, [period])
const dateFrom = oneSenders.length > 0 ? dayjs(oneSenders[0].updatedAt).subtract(period, 'day') : ''
const dateTo = oneSenders.length > 0 ? dayjs(oneSenders[0].updatedAt).subtract(1, 'day'): ''
const dateTo = oneSenders.length > 0 ? dayjs(oneSenders[0].updatedAt).subtract(1, 'day') : ''
const dateUpdate = oneSenders.length > 0 ? dayjs(oneSenders[0].updatedAt) : ''
return <Box gap={'16px'}>
<Box direction={'row'} align={'center'} pad={'8px'} justify={'between'}>
@ -87,11 +88,11 @@ export const TransactionTopStats = () => {
{isLoading && <Spinner size={'small'} />}
</Box>
</Box>
{!isLoading && dateFrom && dateTo &&
{!isLoading && dateFrom && dateTo && dateUpdate &&
<Box pad={{ right: '4px' }}>
<Tip
dropProps={{ align: { bottom: "top" }}}
content={<TipContent showArrow={true} message={`Last update: ${dateTo.format('DD MMM HH:mm:ss')}`} />}
content={<TipContent showArrow={true} message={`Last update: ${dateUpdate.format('DD MMM HH:mm:ss')}`} />}
>
<Box>
{period === MetricsTopPeriod.d1 &&

Loading…
Cancel
Save