Cleanup label help (#3052)
This commit is contained in:
parent
68cb42953d
commit
01c020f62a
@ -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>
|
||||
|
||||
@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user