This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add cookie notice * fix: remove wrong text * fix: prevent flickering of cookie notice * fix: move display logic
- Loading branch information
Showing
4 changed files
with
33 additions
and
12 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from 'react'; | ||
import * as D from '@meetalva/alva-design'; | ||
|
||
export class CookieNotice extends React.Component { | ||
public state = { | ||
display: | ||
typeof document !== 'undefined' && document.cookie.indexOf('hidecookienotice=1') === -1 | ||
}; | ||
|
||
public render() { | ||
return ( | ||
this.state.display === true && ( | ||
<D.CookieNotice | ||
text="This website uses cookies to ensure you get the best experience on our website." | ||
linkText="Learn more" | ||
linkHref="doc/docs/privacypolicy" | ||
buttonText="Got it" | ||
buttonOnClick={() => { | ||
document.cookie = 'hidecookienotice=1;path=/'; | ||
this.setState({ display: false }); | ||
}} | ||
/> | ||
) | ||
); | ||
} | ||
} |
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
1eb9b71
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deployed at: https://alva-commits-1eb9b.surge.sh