-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #662 from adamkendis/612-FRONT-cookieNotice
Cookie notice, privacy policy
- Loading branch information
Showing
12 changed files
with
583 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from 'react'; | ||
import PropTypes from 'proptypes'; | ||
import { Link } from 'react-router-dom'; | ||
import { connect } from 'react-redux'; | ||
import { acceptCookies } from '@reducers/ui'; | ||
|
||
import Button from '@components/common/Button'; | ||
import Icon from '@components/common/Icon'; | ||
|
||
|
||
const CookieNotice = ({ | ||
showCookieNotice, | ||
acceptCookieNotice, | ||
}) => { | ||
const handleClick = () => { | ||
acceptCookieNotice(); | ||
sessionStorage.setItem('accept-cookies', true); | ||
}; | ||
|
||
if (showCookieNotice) { | ||
return ( | ||
<div className="cookie-notice"> | ||
<div className="cookie-title has-text is-size-6 has-text-weight-bold"> | ||
<Icon | ||
id="tooltip-icon" | ||
icon="info-circle" | ||
size="small" | ||
style={{ marginRight: '6px' }} | ||
/> | ||
Cookies and Privacy Policy | ||
</div> | ||
<div className="text has-text is-size-7"> | ||
We use cookies and other tracking technologies to improve your browsing experience and to | ||
better understand our website traffic. By browsing our website, you consent to our use of | ||
cookies and other tracking technologies. | ||
<Link to="/privacy">Learn more</Link> | ||
</div> | ||
<Button | ||
id="cookie-notice" | ||
label="Got it!" | ||
size="small" | ||
handleClick={handleClick} | ||
/> | ||
</div> | ||
); | ||
} | ||
return null; | ||
}; | ||
|
||
const mapStateToProps = state => ({ | ||
showCookieNotice: !state.ui.cookiesAccepted, | ||
}); | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
acceptCookieNotice: () => dispatch(acceptCookies()), | ||
}); | ||
|
||
CookieNotice.propTypes = { | ||
showCookieNotice: PropTypes.bool.isRequired, | ||
acceptCookieNotice: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(CookieNotice); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.