Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[290] Updates welcome modal copy and always shows it #296

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
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