Make Tooltip as a function component with react hooks (#391)

* Refactor `Tooltip` into function component with hooks

With using hooks, we don't need to maintain the checking in sCU and also
don't need to assign the value of `ref` manually.

* Show block number beside the tooltip instead of its children
This commit is contained in:
cybai
2021-09-09 20:02:10 +09:00
committed by GitHub
parent fe19a75414
commit 3ea2f88b19
2 changed files with 62 additions and 71 deletions
@@ -125,9 +125,8 @@ export class ConsensusBlock extends React.Component<ConsensusBlock.Props, {}> {
className="legend"
key={'block_row_' + this.props.height + '_legend'}
>
<Tooltip text={`Block number: ${this.props.height}`}>
{this.displayBlockNumber()}
</Tooltip>
<Tooltip text={`Block number: ${this.props.height}`} />
{this.displayBlockNumber()}
</th>
<th
className="finalizedInfo"