Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/patternfly-4/src/components/banner/banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ const Banner = ({ onClose }) => (
<span class="pf-u-ml-xl custom-text-hide">Looking for PatternFly 3? All documentation and code examples are still available.</span>
<a href="/" class="custom-text-link pf-u-mx-md">Go to PatternFly 3<i class="fas fa-arrow-right pf-u-mx-sm"></i></a>
</div>
{/* <div class="pf-u-mr-xl custom-close-button">
<div class="pf-u-mr-xl custom-close-button">
<Button variant="plain" aria-label="Action" onClick={onClose}>
<TimesIcon />
</Button>
</div> */}
</div>
</div>
);

Expand Down
9 changes: 7 additions & 2 deletions packages/patternfly-4/src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,19 @@ import axios from 'axios';
import './layout.scss';

// Set initial state
let state = { isBannerOpen: true, isExpanded: false, sections: {} };
let state = {
isBannerOpen: true,
isExpanded: false,
sections: {}
};

class Layout extends React.Component {

constructor(props) {
super(props);

// Retrieve the last state
this.state = state;
this.state = Object.assign(state, { isBannerOpen: sessionStorage.getItem('pf4-banner-closed') !== 'true' });
}

componentDidMount() {
Expand Down Expand Up @@ -67,6 +71,7 @@ class Layout extends React.Component {
}

closeBanner = () => {
sessionStorage.setItem('pf4-banner-closed', 'true');
this.setState({
isBannerOpen: false
})
Expand Down