Skip to content

Commit

Permalink
feat: cookie acceptance added to docusaurus website
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroerta committed Jul 4, 2021
1 parent 493e568 commit b7b5b23
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"clsx": "^1.1.1",
"file-loader": "^6.2.0",
"react": "^17.0.1",
"react-cookie-consent": "^6.2.4",
"react-dom": "^17.0.1",
"url-loader": "^4.1.1"
},
Expand Down
20 changes: 18 additions & 2 deletions docs/src/theme/Root.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
import { theme } from '@morfeo/react';
import React from 'react';
import Link from '@docusaurus/Link';
import { parsers, theme } from '@morfeo/react';
import { enableMorfeoDevTool } from '@morfeo/dev-tools';
import CookieConsent from 'react-cookie-consent';
import { lightTheme } from './theme';

enableMorfeoDevTool();

theme.set(lightTheme);

const buttonStyle = parsers.resolve({ borderRadius: 'm' });

function Root({ children }) {
return children;
return (
<>
{children}
<CookieConsent
buttonClasses="button button--secondary button--lg"
buttonStyle={buttonStyle}
>
We use cookies to improve your experience on our site. To find out more,
read our <Link to="/privacy">privacy policy</Link>.
</CookieConsent>
</>
);
}

export default Root;

0 comments on commit b7b5b23

Please sign in to comment.