docs: fixed mobile usability of tooltips (#3124)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import uuid from 'react-uuid';
|
||||
|
||||
import Tooltip from '../Tooltip';
|
||||
import copy from 'copy-text-to-clipboard';
|
||||
@@ -18,10 +19,16 @@ export default function CopyButton ({ children, buttonClassName, text, tooltipCl
|
||||
useEffect(() => () => window.clearTimeout(copyTimeout.current), []);
|
||||
|
||||
return (
|
||||
<Tooltip text={isCopied ? `Copied!` : `Copy to Clipboard`} tooltipClassName={tooltipClassName}>
|
||||
<button className={`copy-action ${buttonClassName}`} onClick={handleCopy}>
|
||||
<Tooltip
|
||||
text={isCopied ? `Copied!` : `Copy to Clipboard`}
|
||||
tooltipClassName={tooltipClassName}
|
||||
>
|
||||
<span
|
||||
className={`copy-action ${buttonClassName}`}
|
||||
onClick={handleCopy}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
</span>
|
||||
</Tooltip>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user