-
Notifications
You must be signed in to change notification settings - Fork 1
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 #145 from comicrelief/144_create_cookie_message
Add cookie consent message
- Loading branch information
Showing
10 changed files
with
3,165 additions
and
1,684 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
37 changes: 37 additions & 0 deletions
37
src/components/CookieConsentMessage/CookieConsentMessage.js
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,37 @@ | ||
import React, { Component } from 'react'; | ||
import CookieConsent from 'react-cookie-consent'; | ||
|
||
|
||
class CookieConsentMessage extends Component { | ||
render() { | ||
const option = { | ||
buttonClass: 'btn btn--white-ghost', | ||
containerClass: 'cookie-consent cc_container', | ||
linkClass: 'cc_more_info link link--grey inline', | ||
buttonText: 'Accept', | ||
cookieName: 'cookie-consent', | ||
contentClass: 'cc_message', | ||
position: 'top', | ||
}; | ||
|
||
return ( | ||
<CookieConsent | ||
disableStyles | ||
location={option.position} | ||
buttonText={option.buttonText} | ||
cookieName={option.cookieName} | ||
containerClasses={option.containerClass} | ||
buttonClasses={option.buttonClass} | ||
contentClasses={option.contentClass} | ||
> | ||
We use cookies. We’ve recently updated our privacy policy to give you more detail about how we use your personal information.{' '} | ||
<a href="https://www.comicrelief.com/privacy-notice" className={option.linkClass} target="_blank" rel="noopener noreferrer"> | ||
Read our privacy policy here. | ||
</a> | ||
</CookieConsent> | ||
); | ||
} | ||
} | ||
|
||
export default CookieConsentMessage; | ||
|
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,11 @@ | ||
{ | ||
"name": "cookie-consent-message", | ||
"version": "0.0.0", | ||
"private": true, | ||
"main": "./CookieConsentMessage.js", | ||
"dependencies": { | ||
"react": "^16.3.1", | ||
"prop-types": "^15.6.1", | ||
"react-cookie-consent": "^1.4.0" | ||
} | ||
} |
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
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.