Commit 5d381fef authored by Joram Wilander's avatar Joram Wilander Committed by JoramWilander

Fix announcement banner overlapping (#2186)

parent fbb89236
......@@ -24,6 +24,24 @@ export default class AnnouncementBar extends React.PureComponent {
handleClose: null,
}
componentDidMount() {
this.setBodyClass(!this.props.showCloseButton);
}
componentDidUpdate(prevProps) {
if (this.props.showCloseButton !== prevProps.showCloseButton) {
this.setBodyClass(!this.props.showCloseButton);
}
}
setBodyClass = (fixed) => {
if (fixed) {
document.body.classList.add('announcement-bar--fixed');
} else {
document.body.classList.remove('announcement-bar--fixed');
}
}
handleClose = (e) => {
e.preventDefault();
if (this.props.handleClose) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment