Skip to content

Commit

Permalink
#313 Install react-cookie-consent.
Browse files Browse the repository at this point in the history
  • Loading branch information
pleszkiewicz committed Feb 4, 2021
1 parent 584d7a9 commit 8c6c054
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"classnames": "^2.2.6",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-script-loader-hoc": "^1.2.2"
"react-script-loader-hoc": "^1.2.2",
"react-cookie-consent": "^6.2.2"
},
"browserslist": {
"production": [
Expand Down
28 changes: 14 additions & 14 deletions website/src/theme/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

import React from "react";
import ScriptLoader from "react-script-loader-hoc";

function createMarkup() {
return {
__html: window.startCookieControl.load({
apiKey: "bd100834001edf98bd5458ce61e48ca552418f9c",
footerSelector: "#foot-boi"
})
};
}
import CookieConsent, { Cookie } from "react-cookie-consent";

const MLFooter = ({ scriptsLoadedSuccessfully }) => {
if (!scriptsLoadedSuccessfully) return null;
return <section id="foot-boi" dangerouslySetInnerHTML={createMarkup()} />;
return <CookieConsent
location="bottom"
buttonText="Accept All Cookies"
cookieName="defaultCookie"
style={{ background: "#4A4A4AEE", color: "#F8F8F8", fontSize: "15px", fontWeight: "bold", paddingLeft: 80, paddingRight: 80 }}
buttonStyle={{ flex: "0 1 auto", background: "#F8F8F8", color: "#4A4A4A", fontSize: "16px", fontWeight: "bold", borderRadius: 4, padding: 13 }}
expires={30}
>
Magic Leap uses cookies to enhance your user experience, improve our websites, and deliver ads that may interest you.
<div />
<a style={{ color: "#F8F8F8", fontSize: "16px" , fontWeight: "normal" }} href="https://www.magicleap.com/legal/cookie-policy">Learn More</a>
</CookieConsent>
};

export default ScriptLoader(
"https://magicleap.com/assets/js/cookie-control-js/cookie-control-vanilla.min.js"
)(MLFooter);
export default ScriptLoader()(MLFooter);

0 comments on commit 8c6c054

Please sign in to comment.