KeygenStep: simplify it, add a tooltip over "Next" button
This commit is contained in:
@ -15,13 +15,15 @@ interface ITooltip {
|
||||
children: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
||||
/** Text to display in the tooltip. */
|
||||
text: string;
|
||||
/** If disabled, it will render the children without wrapping them. */
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tooltip
|
||||
*/
|
||||
const Tooltip: React.FC<ITooltip> = (props) => {
|
||||
const { children, text } = props;
|
||||
const { children, text, disabled = false } = props;
|
||||
|
||||
const [isOpen, setIsOpen] = useState<boolean>(false);
|
||||
|
||||
@ -55,6 +57,10 @@ const Tooltip: React.FC<ITooltip> = (props) => {
|
||||
hover,
|
||||
]);
|
||||
|
||||
if (disabled) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{React.cloneElement(children, {
|
||||
|
||||
Reference in New Issue
Block a user