Update Tooltip

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-09-06 14:49:51 +03:00
parent e7dd2358d0
commit 75206e59d5

View File

@ -29,7 +29,7 @@ Renders a tooltip component.
``` ```
```jsx ```jsx
function Tooltip({ children, text, ...rest }) { const Tooltip = ({ children, text, ...rest }) => {
const [show, setShow] = React.useState(false); const [show, setShow] = React.useState(false);
return ( return (
@ -38,12 +38,12 @@ function Tooltip({ children, text, ...rest }) {
{text} {text}
<span className="tooltip-arrow" /> <span className="tooltip-arrow" />
</div> </div>
<div {...rest} onMouseEnter={() => setShow(true)} onMouseLeave={() => setShow(false)}> <div onMouseEnter={() => setShow(true)} onMouseLeave={() => setShow(false)} {...rest}>
{children} {children}
</div> </div>
</div> </div>
); );
} };
``` ```
```jsx ```jsx