docs: added show/hide sidebar button (#4150)

* docs: added show/hide sidebar button

* added check for browser

* fix build error

* solve build errors
This commit is contained in:
Shahed Nasser
2023-05-22 19:44:50 +03:00
committed by GitHub
parent 0476f52519
commit 87444488b5
29 changed files with 589 additions and 188 deletions

View File

@@ -5,15 +5,17 @@ import uuid from "react-uuid"
import "react-tooltip/dist/react-tooltip.css"
type TooltipProps = {
text: string
text?: string
tooltipClassName?: string
html?: string
} & React.HTMLAttributes<HTMLSpanElement> &
ITooltip
const Tooltip: React.FC<TooltipProps> = ({
text,
text = "",
tooltipClassName = "",
children,
html = "",
}) => {
const [elementId, setElementId] = useState(null)
@@ -25,7 +27,7 @@ const Tooltip: React.FC<TooltipProps> = ({
return (
<>
<span id={elementId} data-tooltip-content={text}>
<span id={elementId} data-tooltip-content={text} data-tooltip-html={html}>
{children}
</span>
<ReactTooltip