-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
3,257 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,6 @@ config.js | |
|
||
## Coverall | ||
.coveralls.yml | ||
|
||
## Content | ||
src/content/privacy.md |
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
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
41 changes: 41 additions & 0 deletions
41
src/components/cookie-notice/__tests__/__snapshots__/index.test.js.snap
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,41 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Component/CookieNotice should render without throwing an error 1`] = ` | ||
<div | ||
className="cookie-notice" | ||
> | ||
<CookieBanner | ||
buttonMessage="OK" | ||
className="cookie-notice--banner" | ||
cookie="user-has-accepted-cookies" | ||
cookieExpiration={ | ||
Object { | ||
"years": 1, | ||
} | ||
} | ||
cookiePath="/" | ||
cookies={ | ||
Cookies { | ||
"HAS_DOCUMENT_COOKIE": true, | ||
"changeListeners": Array [], | ||
"cookies": Object {}, | ||
"hooks": undefined, | ||
} | ||
} | ||
disableStyle={true} | ||
dismissOnScroll={false} | ||
dismissOnScrollThreshold={0} | ||
link={ | ||
<Link | ||
replace={false} | ||
to="/privacy" | ||
> | ||
here. | ||
</Link> | ||
} | ||
message="We use cookies to give you the best online experience. See what we do and how you can disagree " | ||
onAccept={[Function]} | ||
styles={Object {}} | ||
/> | ||
</div> | ||
`; |
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,9 @@ | ||
import React from 'react' | ||
import { shallow } from 'enzyme' | ||
import CookieNotice from '../' | ||
|
||
describe('Component/CookieNotice', () => { | ||
test('should render without throwing an error', () => { | ||
expect(shallow(<CookieNotice />)).toMatchSnapshot() | ||
}) | ||
}) |
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,26 @@ | ||
/* eslint-disable jsx-a11y/anchor-is-valid */ | ||
import React from 'react' | ||
import { Link } from 'react-router-dom' | ||
import CookieBanner from 'react-cookie-banner' | ||
|
||
const message = | ||
'We use cookies to give you the best online experience. See what we do and how you can disagree ' | ||
|
||
// TODO | ||
// - add notice only if config.google_analytics_property = true | ||
const CookieNotice = () => ( | ||
<div className="cookie-notice"> | ||
<CookieBanner | ||
className="cookie-notice--banner" | ||
cookiePath="/" | ||
cookie="user-has-accepted-cookies" | ||
dismissOnScroll={false} | ||
disableStyle | ||
buttonMessage="OK" | ||
link={<Link to="/privacy">here.</Link>} | ||
message={message} | ||
/> | ||
</div> | ||
) | ||
|
||
export default 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.cookie-notice { | ||
background-color: $primary-color; | ||
padding-left: 5px; | ||
padding-top: 5px; | ||
|
||
&--banner { | ||
align-items: center; | ||
background-color: #484848; | ||
color: #fff; | ||
display: flex; | ||
height: auto; | ||
justify-content: space-evenly; | ||
padding: 10px 15px; | ||
|
||
a { | ||
color: #fff; | ||
} | ||
} | ||
|
||
.cookie-message { | ||
padding-right: 15px; | ||
} | ||
|
||
.button-close { | ||
background-color: #fff; | ||
cursor: pointer; | ||
flex: 0 0 auto; // important for mobile | ||
font-weight: bold; | ||
margin-right: 15px; // important for mobile | ||
outline: 0; | ||
padding: 0.75em; | ||
text-align: center; | ||
text-decoration: none; | ||
text-transform: uppercase; | ||
width: 100px; | ||
} | ||
} |
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,3 @@ | ||
## Data privacy statement | ||
|
||
Your statement goes here. |
Oops, something went wrong.