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