mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Add closing logic
This commit is contained in:
parent
6e1cb2f8ad
commit
8e7a150237
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user