web2019/static/js/shop/options/Notification.jsx
2024-01-09 10:14:53 +08:00

19 lines
730 B
JavaScript

import {OverlayTrigger, Tooltip} from "react-bootstrap";
import React, {useState} from "react";
export function Notification({id, tip, content}) {
const [show, setShow] = useState(true);
return (
<div className="" onClick={() => setShow(false)}>
{content}
<OverlayTrigger
placement="auto"
trigger={['click', 'hover', 'focus']}
style={{display: show ? 'inline' : "hidden"}}
overlay={<Tooltip id={id}>{tip}</Tooltip>}
>
<img src="/images/shop/icon-notification.svg" className="options-notification" style={{display: show ? 'inline' : "hidden"}}/>
</OverlayTrigger>
</div>
)
}