mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Connected announcement bar to Settings API data
refs https://github.com/TryGhost/Team/issues/3009 - The change hooks up the announcement bar script to use "announcement" and "announcement_background" values coming from the Content Settings API
This commit is contained in:
parent
8e7a150237
commit
7270c17a1d
@ -5,16 +5,15 @@ 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;
|
||||
}
|
||||
|
||||
let className = 'gh-announcement-bar ' + settings?.announcement_background;
|
||||
return (
|
||||
<div className="gh-announcement-bar dark">
|
||||
<div className="gh-announcement-bar-content" dangerouslySetInnerHTML={{__html: data.content}}></div>
|
||||
<div className={className}>
|
||||
<div className="gh-announcement-bar-content" dangerouslySetInnerHTML={{__html: settings?.announcement}}></div>
|
||||
<button onClick={() => setVisible(false)}>
|
||||
<CloseIcon />
|
||||
</button>
|
||||
|
Loading…
Reference in New Issue
Block a user