more
This commit is contained in:
@@ -3,22 +3,21 @@ import "../styles/tooltip.scss";
|
|||||||
import { InfoCircle, Clock } from "react-bootstrap-icons";
|
import { InfoCircle, Clock } from "react-bootstrap-icons";
|
||||||
|
|
||||||
function Tooltip(props) {
|
function Tooltip(props) {
|
||||||
const [show, setShow] = useState(false);
|
const [showMessage, setShowMessage] = useState(false);
|
||||||
const { text, iconStyle } = props;
|
const { text, iconStyle } = props;
|
||||||
const showClock = iconStyle === "clock";
|
const showClock = iconStyle === "clock";
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="tooltip-container"
|
className="tooltip-container"
|
||||||
onMouseEnter={() => setShow(true)}
|
onMouseEnter={() => setShowMessage(true)}
|
||||||
onMouseLeave={() => setShow(false)}
|
onMouseLeave={() => setShowMessage(false)}
|
||||||
>
|
>
|
||||||
{showClock ? (
|
{showClock ? (
|
||||||
<Clock className="infocircle-icon" size="16px" />
|
<Clock className="infocircle-icon" size="16px" />
|
||||||
) : (
|
) : (
|
||||||
<InfoCircle className="infocircle-icon" size="16px" />
|
<InfoCircle className="infocircle-icon" size="16px" />
|
||||||
)}
|
)}
|
||||||
|
{showMessage ? <span className="tooltip-text">{text}</span> : <></>}
|
||||||
{show ? <span className="tooltip-text">{text}</span> : <></>}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user