Skip to content

Commit 6780d45

Browse files
committed
feat(neuron-ui): use tooltip component instead of element title to display the sync progress.
1 parent c5b5c86 commit 6780d45

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

  • packages/neuron-ui/src/containers/Footer

packages/neuron-ui/src/containers/Footer/index.tsx

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useCallback, useContext } from 'react'
22
import { createPortal } from 'react-dom'
33
import { RouteComponentProps } from 'react-router-dom'
44
import { useTranslation } from 'react-i18next'
5-
import { Stack, getTheme, Text, ProgressIndicator, Icon } from 'office-ui-fabric-react'
5+
import { Stack, getTheme, Text, ProgressIndicator, Icon, TooltipHost } from 'office-ui-fabric-react'
66

77
import { StateWithDispatch } from 'states/stateProvider/reducer'
88
import { ConnectionStatus, FULL_SCREENS, Routes } from 'utils/const'
@@ -33,20 +33,19 @@ export const SyncStatus = ({
3333

3434
const percentage = +syncedBlockNumber / +tipBlockNumber
3535

36-
return (
37-
<div style={{ display: 'flex', alignItems: 'center' }} title={`${syncedBlockNumber} / ${tipBlockNumber}`}>
38-
{+syncedBlockNumber + bufferBlockNumber < +tipBlockNumber ? (
39-
<>
40-
{t('sync.syncing')}
41-
<ProgressIndicator
42-
percentComplete={percentage}
43-
styles={{ root: { width: '120px', marginLeft: '5px', marginRight: '5px' } }}
44-
/>
45-
</>
46-
) : (
47-
<>{t('sync.synced')}</>
48-
)}
49-
</div>
36+
return +syncedBlockNumber + bufferBlockNumber < +tipBlockNumber ? (
37+
<TooltipHost
38+
content={`${syncedBlockNumber} / ${tipBlockNumber}`}
39+
styles={{ root: { display: 'flex', justifyContent: 'center', alignItems: 'center' } }}
40+
>
41+
{t('sync.syncing')}
42+
<ProgressIndicator
43+
percentComplete={percentage}
44+
styles={{ root: { width: '120px', marginLeft: '5px', marginRight: '5px' } }}
45+
/>
46+
</TooltipHost>
47+
) : (
48+
<>{t('sync.synced')}</>
5049
)
5150
}
5251

0 commit comments

Comments
 (0)