Merge pull request #232 from ArtemKolodko/master

Fixed update date for top charts tip
pull/236/head
Artem 2 years ago committed by GitHub
commit 6331a7924f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/pages/TopStatsPage/Transaction.tsx

@ -73,7 +73,8 @@ export const TransactionTopStats = () => {
}, [period]) }, [period])
const dateFrom = oneSenders.length > 0 ? dayjs(oneSenders[0].updatedAt).subtract(period, 'day') : '' 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'}> return <Box gap={'16px'}>
<Box direction={'row'} align={'center'} pad={'8px'} justify={'between'}> <Box direction={'row'} align={'center'} pad={'8px'} justify={'between'}>
@ -87,11 +88,11 @@ export const TransactionTopStats = () => {
{isLoading && <Spinner size={'small'} />} {isLoading && <Spinner size={'small'} />}
</Box> </Box>
</Box> </Box>
{!isLoading && dateFrom && dateTo && {!isLoading && dateFrom && dateTo && dateUpdate &&
<Box pad={{ right: '4px' }}> <Box pad={{ right: '4px' }}>
<Tip <Tip
dropProps={{ align: { bottom: "top" }}} 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> <Box>
{period === MetricsTopPeriod.d1 && {period === MetricsTopPeriod.d1 &&

Loading…
Cancel
Save