Skip to content

Commit

Permalink
[290] Updates welcome modal copy and always shows it
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpilone committed Oct 24, 2023
1 parent 085ae16 commit 9cf4487
Showing 1 changed file with 13 additions and 35 deletions.
48 changes: 13 additions & 35 deletions website/src/js/layouts/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ const navigation_links = [
},
];

const firstVisitCookieName = "obp-search_visited";

class Main extends Component {

componentDidMount() {
Expand All @@ -62,19 +60,10 @@ class Main extends Component {
this.props.history.push(route);
}

// sets cookie on welcome message modal close
handleWelcomeModalClose() {
const cookieDate = new Date();
cookieDate.setFullYear(cookieDate.getFullYear() + 1);
document.cookie = `${firstVisitCookieName}=true; expires=${cookieDate.toUTCString()};`;
}

render() {

const { search, activeSearch } = this.props.searchReducer;

const isFirstTimeVisit = !document.cookie.includes(firstVisitCookieName);

return (
<Wrapper header={false} page="landing" childrenContainerClass="landing" footerLinks={true}>
<section className='landing__header'>
Expand Down Expand Up @@ -134,30 +123,19 @@ class Main extends Component {
</div>
</section>

{isFirstTimeVisit && (
<FullScreenModal
open={true}
noLink={true}
modalTitle="Welcome to Ocean Best Practices"
onClose={this.handleWelcomeModalClose}
closeLabel="Accept and Continue"
>
<div className="link__list-toggle-modal welcome-modal">
<p>
The Ocean Best Practices System (OBPS) is a secure, permanent global repository of ocean research, operations, data/information management and
applications methodologies (also known as “BestPractices”) ** The OBPS invites the ocean community to submit their own methodologies to share
globally with their colleagues.
</p>
<p>
Please note, unless it is annotated as Endorsed by an Expert Panel, inclusion of a methodology in OBPS does not indicate a recommendation by OBPS.
</p>
<p className="foot-notes">
<b>**</b> A Best Practice is defined as “a methodology that has repeatedly produced superior results relative to other methodologies with the same objective”. To be fully elevated to a best practice,
a promising method will have been adopted and employed by multiple organizations.
</p>
</div>
</FullScreenModal>
)}
<FullScreenModal
open={true}
noLink={true}
modalTitle="Welcome to Ocean Best Practices"
closeLabel="Continue"
>
<div className="link__list-toggle-modal welcome-modal">
<p>
The OBPS is a secure, permanent global repository of ocean research, operations, data/information and applications methods.
Methods not showing as “ENDORSED” may not be best practices.
</p>
</div>
</FullScreenModal>
</Wrapper>
);
}
Expand Down

0 comments on commit 9cf4487

Please sign in to comment.