Add closing logic

This commit is contained in:
Sodbileg Gansukh 2023-04-19 15:29:59 +01:00 committed by Elena Baidakova
parent 6e1cb2f8ad
commit 8e7a150237

View File

@ -4,13 +4,18 @@ import './AnnouncementBar.css';
import {ReactComponent as CloseIcon} from '../icons/clear.svg';
export function AnnouncementBar({settings}) {
const [visible, setVisible] = React.useState(true);
// eslint-disable-next-line no-unused-vars
const [data, setData] = React.useState({content: '<p>Content with <a href="https://ghost.org/">link</a></p>'});
if (!visible) {
return null;
}
return (
<div className="gh-announcement-bar dark">
<div className="gh-announcement-bar-content" dangerouslySetInnerHTML={{__html: data.content}}></div>
<button>
<button onClick={() => setVisible(false)}>
<CloseIcon />
</button>
</div>