Cleanup label help (#3052)

This commit is contained in:
Jaco Greeff 2020-06-25 17:38:22 +02:00 committed by GitHub
parent 68cb42953d
commit 01c020f62a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 11 deletions

View File

@ -22,7 +22,7 @@ function HelpOverlay ({ className = '', md }: Props): React.ReactElement<Props>
<div className={className}>
<div className='help-button'>
<Icon
icon='help-circle'
icon='question-circle'
onClick={toggleVisible}
/>
</div>

View File

@ -6,7 +6,6 @@ import { BareProps } from './types';
import React, { useState } from 'react';
import styled from 'styled-components';
import { useToggle } from '@polkadot/react-hooks';
import Icon from './Icon';
import { classes } from './util';
@ -20,22 +19,17 @@ let id = 0;
function LabelHelp ({ className = '', help }: Props): React.ReactElement<Props> {
const [trigger] = useState(`label-help-${++id}`);
const [isTooltipOpen, toggleTooltip] = useToggle();
return (
<div className={classes('ui--LabelHelp', className)}>
<Icon
icon='question-circle'
onMouseOut={toggleTooltip}
onMouseOver={toggleTooltip}
tooltip={trigger}
/>
{isTooltipOpen && (
<Tooltip
text={help}
trigger={trigger}
/>
)}
<Tooltip
text={help}
trigger={trigger}
/>
</div>
);
}