From 988c897eacf568c420cf5d5e468961cf675957d7 Mon Sep 17 00:00:00 2001 From: Visa Pollari Date: Wed, 5 Aug 2020 11:39:03 +0300 Subject: [PATCH] Add consent bar --- frontend/app/package-lock.json | 13 ++ frontend/app/package.json | 1 + frontend/app/src/App.js | 5 + .../app/src/pages/Connected/Home/index.js | 8 +- frontend/app/src/redux/staticcontent/keys.js | 202 +++++++++--------- 5 files changed, 124 insertions(+), 105 deletions(-) diff --git a/frontend/app/package-lock.json b/frontend/app/package-lock.json index f0fe814d..5656f956 100644 --- a/frontend/app/package-lock.json +++ b/frontend/app/package-lock.json @@ -8961,6 +8961,11 @@ "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz", "integrity": "sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ==" }, + "js-cookie": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz", + "integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -12319,6 +12324,14 @@ } } }, + "react-cookie-consent": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/react-cookie-consent/-/react-cookie-consent-5.1.3.tgz", + "integrity": "sha512-a1eZM7/SrKq/L9SJfEkpLDtA9sfovW+fBOR/jIwIvDX0AxoogZibyJT92LvElPWhS27APeTqROOy4OngAahZYQ==", + "requires": { + "js-cookie": "^2.2.1" + } + }, "react-countdown-now": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/react-countdown-now/-/react-countdown-now-2.1.2.tgz", diff --git a/frontend/app/package.json b/frontend/app/package.json index 9ba67206..1a053221 100644 --- a/frontend/app/package.json +++ b/frontend/app/package.json @@ -19,6 +19,7 @@ "node-sass": "^4.14.1", "react": "^16.13.1", "react-animate-height": "^2.0.21", + "react-cookie-consent": "^5.1.3", "react-countdown-now": "^2.1.2", "react-dom": "^16.13.1", "react-ga": "^3.0.0", diff --git a/frontend/app/src/App.js b/frontend/app/src/App.js index 8acc3883..c5279558 100755 --- a/frontend/app/src/App.js +++ b/frontend/app/src/App.js @@ -25,6 +25,7 @@ import config from "./services/config"; import BasicPage from "./pages/BasicPage"; import NotFoundPage from "./pages/Connected/NotFound"; +import CookieConsent from "react-cookie-consent"; import Connected from "./pages/Connected"; import Junction from "./pages/Junction"; @@ -71,6 +72,10 @@ class App extends PureComponent { {/*Junction Base module */} + + This website uses cookies to enhance the user + experience. Please read our privacy policy for details. + diff --git a/frontend/app/src/pages/Connected/Home/index.js b/frontend/app/src/pages/Connected/Home/index.js index 2c5a2262..5bc21b40 100644 --- a/frontend/app/src/pages/Connected/Home/index.js +++ b/frontend/app/src/pages/Connected/Home/index.js @@ -19,7 +19,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import Page from "../../PageHOC"; import Button from "../../../components/Button"; -const ConnectedHome = ({}) => { +import { content as selectContent } from "../../redux/staticcontent/selectors"; + +const ConnectedHome = ({ state }) => { return ( { { ); }; - -export default ConnectedHome; diff --git a/frontend/app/src/redux/staticcontent/keys.js b/frontend/app/src/redux/staticcontent/keys.js index cba8af69..dab53c23 100644 --- a/frontend/app/src/redux/staticcontent/keys.js +++ b/frontend/app/src/redux/staticcontent/keys.js @@ -1,116 +1,116 @@ const CONTENT_KEYS = { - /* Sitewide */ - siteSlogan: 'siteSlogan', - siteContactEmail: 'siteContactEmail', - homePageHeaderVideoLink: 'homePageHeaderVideoLink', + /* Sitewide */ + siteSlogan: "siteSlogan", + siteContactEmail: "siteContactEmail", + homePageHeaderVideoLink: "homePageHeaderVideoLink", - /* Contact form */ - newsletterFormTitle: 'newsletterFormTitle', - newsletterFormSubtitle: 'newsletterFormSubtitle', - contactFormTitle: 'contactFormTitle', - contactFormSubtitle: 'contactFormSubtitle', + /* Contact form */ + newsletterFormTitle: "newsletterFormTitle", + newsletterFormSubtitle: "newsletterFormSubtitle", + contactFormTitle: "contactFormTitle", + contactFormSubtitle: "contactFormSubtitle", - /* Home page */ - whoAreWe: 'whoAreWe', - whoAreWeBody: 'whoAreWeBody', - whoAreWeGlobal: 'whoAreWeGlobal', + /* Home page */ + whoAreWe: "whoAreWe", + whoAreWeBody: "whoAreWeBody", + whoAreWeGlobal: "whoAreWeGlobal", - whoAreWeSubtitle: 'whoAreWeSubtitle', - whatWeDo: 'whatWeDo', - whatWeDoBody: 'whatWeDoBody', - whatWeDoSubtitle: 'whatWeDoSubtitle', - storiesAboutUsTitle: 'storiesAboutUsTitle', - storiesAboutUsSubtitle: 'storiesAboutUsSubtitle', + whoAreWeSubtitle: "whoAreWeSubtitle", + whatWeDo: "whatWeDo", + whatWeDoBody: "whatWeDoBody", + whatWeDoSubtitle: "whatWeDoSubtitle", + storiesAboutUsTitle: "storiesAboutUsTitle", + storiesAboutUsSubtitle: "storiesAboutUsSubtitle", - /* Story page */ - storyPageTitle: 'storyPageTitle', - storyPageSubtitle: 'storyPageSubtitle', - whatIsJunctionTitle: 'whatIsJunctionTitle', - whatIsJunctionSubtitle: 'whatIsJunctionSubtitle', - whatIsJunctionBody: 'whatIsJunctionBody', - storyPageContent: 'storyPageContent', - junction2019: 'junction2019', - junction2019Body: 'junction2019Body', - junction2019Subtitle: 'junction2019Subtitle', + /* Story page */ + storyPageTitle: "storyPageTitle", + storyPageSubtitle: "storyPageSubtitle", + whatIsJunctionTitle: "whatIsJunctionTitle", + whatIsJunctionSubtitle: "whatIsJunctionSubtitle", + whatIsJunctionBody: "whatIsJunctionBody", + storyPageContent: "storyPageContent", + junction2019: "junction2019", + junction2019Body: "junction2019Body", + junction2019Subtitle: "junction2019Subtitle", - /* Calendar page */ - calendarPageTitle: 'calendarPageTitle', - calendarPageSubtitle: 'calendarPageSubtitle', + /* Calendar page */ + calendarPageTitle: "calendarPageTitle", + calendarPageSubtitle: "calendarPageSubtitle", - /* Concepts page */ - conceptsPageTitle: 'conceptsPageTitle', - conceptsPageSubtitle: 'conceptsPageSubtitle', + /* Concepts page */ + conceptsPageTitle: "conceptsPageTitle", + conceptsPageSubtitle: "conceptsPageSubtitle", - /* Partners page */ - partnersPageTitle: 'partnersPageTitle', - partnersPageSubtitle: 'partnersPageSubtitle', - partnersPageFirstTitle: 'partnersPageFirstTitle', - partnersPageFirstSubtitle: 'partnersPageFirstSubtitle', - partnersPageFirstBody: 'partnersPageFirstBody', - partnersPageVideo: 'partnersPageVideo', - whyPartnerWithUsTitle: 'whyPartnerWithUsTitle', - whyPartnerWithUsFirstTitle: 'whyPartnerWithUsFirstTitle', - whyPartnerWithUsFirstBody: 'whyPartnerWithUsFirstBody', - whyPartnerWithUsSecondTitle: 'whyPartnerWithUsSecondTitle', - whyPartnerWithUsSecondBody: 'whyPartnerWithUsSecondBody', - whyPartnerWithUsThirdTitle: 'whyPartnerWithUsThirdTitle', - whyPartnerWithUsThirdBody: 'whyPartnerWithUsThirdBody', - whatMakesUsDifferentTitle: 'whatMakesUsDifferentTitle', - whatMakesUsDifferentSubtitle: 'whatMakesUsDifferentSubtitle', - whatMakesUsDifferentBody: 'whatMakesUsDifferentBody', - previousPartnersTitle: 'previousPartnersTitle', - previousPartnersSubtitle: 'previousPartnersSubtitle', - previousPartnersBody: 'previousPartnersBody', + /* Partners page */ + partnersPageTitle: "partnersPageTitle", + partnersPageSubtitle: "partnersPageSubtitle", + partnersPageFirstTitle: "partnersPageFirstTitle", + partnersPageFirstSubtitle: "partnersPageFirstSubtitle", + partnersPageFirstBody: "partnersPageFirstBody", + partnersPageVideo: "partnersPageVideo", + whyPartnerWithUsTitle: "whyPartnerWithUsTitle", + whyPartnerWithUsFirstTitle: "whyPartnerWithUsFirstTitle", + whyPartnerWithUsFirstBody: "whyPartnerWithUsFirstBody", + whyPartnerWithUsSecondTitle: "whyPartnerWithUsSecondTitle", + whyPartnerWithUsSecondBody: "whyPartnerWithUsSecondBody", + whyPartnerWithUsThirdTitle: "whyPartnerWithUsThirdTitle", + whyPartnerWithUsThirdBody: "whyPartnerWithUsThirdBody", + whatMakesUsDifferentTitle: "whatMakesUsDifferentTitle", + whatMakesUsDifferentSubtitle: "whatMakesUsDifferentSubtitle", + whatMakesUsDifferentBody: "whatMakesUsDifferentBody", + previousPartnersTitle: "previousPartnersTitle", + previousPartnersSubtitle: "previousPartnersSubtitle", + previousPartnersBody: "previousPartnersBody", - /* Volunteers page */ - volunteersPageTitle: 'volunteersPageTitle', - volunteersPageSubtitle: 'volunteersPageSubtitle', - volunteeringTitle: 'volunteeringTitle', - volunteeringSubtitle: 'volunteeringSubtitle', - volunteeringBody: 'volunteeringBody', - volunteersPageMidContent: 'volunteersPageMidContent', + /* Volunteers page */ + volunteersPageTitle: "volunteersPageTitle", + volunteersPageSubtitle: "volunteersPageSubtitle", + volunteeringTitle: "volunteeringTitle", + volunteeringSubtitle: "volunteeringSubtitle", + volunteeringBody: "volunteeringBody", + volunteersPageMidContent: "volunteersPageMidContent", - /* Participants page */ - participantsPageTitle: 'participantsPageTitle', - participantsPageSubtitle: 'participantsPageSubtitle', - howToJoinTitle: 'howToJoinTitle', - howToJoinSubtitle: 'howToJoinSubtitle', - howToJoinStepOne: 'howToJoinStepOne', - howToJoinStepTwo: 'howToJoinStepTwo', - howToJoinStepThree: 'howToJoinStepThree', - howToJoinStepFour: 'howToJoinStepFour', - howToJoinStepFive: 'howToJoinStepFive', - getHiredTitle: 'getHiredTitle', - getHiredSubtitle: 'getHiredSubtitle', - getHiredBody: 'getHiredBody', + /* Participants page */ + participantsPageTitle: "participantsPageTitle", + participantsPageSubtitle: "participantsPageSubtitle", + howToJoinTitle: "howToJoinTitle", + howToJoinSubtitle: "howToJoinSubtitle", + howToJoinStepOne: "howToJoinStepOne", + howToJoinStepTwo: "howToJoinStepTwo", + howToJoinStepThree: "howToJoinStepThree", + howToJoinStepFour: "howToJoinStepFour", + howToJoinStepFive: "howToJoinStepFive", + getHiredTitle: "getHiredTitle", + getHiredSubtitle: "getHiredSubtitle", + getHiredBody: "getHiredBody", - /* Team page */ - teamPageTitle: 'teamPageTitle', - teamPageSubtitle: 'teamPageSubtitle', - teamPageVolunteerTitle: 'teamPageVolunteerTitle', - teamPageVolunteerSubtitle: 'teamPageVolunteerSubtitle', - teamPageVolunteerBody: 'teamPageVolunteerBody', + /* Team page */ + teamPageTitle: "teamPageTitle", + teamPageSubtitle: "teamPageSubtitle", + teamPageVolunteerTitle: "teamPageVolunteerTitle", + teamPageVolunteerSubtitle: "teamPageVolunteerSubtitle", + teamPageVolunteerBody: "teamPageVolunteerBody", - /* Organisers page */ - organisersPageTitle: 'organisersPageTitle', - organisersPageSubtitle: 'organisersPageSubtitle', - whatIsJunctionXTitle: 'whatIsJunctionXTitle', - whatIsJunctionXSubtitle: 'whatIsJunctionXSubtitle', - whatIsJunctionXBody: 'whatIsJunctionXBody', - whatDoesJunctionXOfferTitle: 'whatDoesJunctionXOfferTitle', - whatDoesJunctionXOfferSubtitle: 'whatDoesJunctionXOfferSubtitle', - whatDoesJunctionXOfferFirstTitle: 'whatDoesJunctionXOfferFirstTitle', - whatDoesJunctionXOfferFirstBody: 'whatDoesJunctionXOfferFirstBody', - whatDoesJunctionXOfferSecondTitle: 'whatDoesJunctionXOfferSecondTitle', - whatDoesJunctionXOfferSecondBody: 'whatDoesJunctionXOfferSecondBody', - whatDoesJunctionXOfferThirdTitle: 'whatDoesJunctionXOfferThirdTitle', - whatDoesJunctionXOfferThirdBody: 'whatDoesJunctionXOfferThirdBody', - whatDoesJunctionXOfferFourthTitle: 'whatDoesJunctionXOfferFourthTitle', - whatDoesJunctionXOfferFourthBody: 'whatDoesJunctionXOfferFourthBody', - organiserPageBottomContent: 'organiserPageBottomContent', - interestedInOrganisingTitle: 'interestedInOrganisingTitle', - interestedInOrganisingSubtitle: 'interestedInOrganisingSubtitle', - interestedInOrganisingBody: 'interestedInOrganisingBody' + /* Organisers page */ + organisersPageTitle: "organisersPageTitle", + organisersPageSubtitle: "organisersPageSubtitle", + whatIsJunctionXTitle: "whatIsJunctionXTitle", + whatIsJunctionXSubtitle: "whatIsJunctionXSubtitle", + whatIsJunctionXBody: "whatIsJunctionXBody", + whatDoesJunctionXOfferTitle: "whatDoesJunctionXOfferTitle", + whatDoesJunctionXOfferSubtitle: "whatDoesJunctionXOfferSubtitle", + whatDoesJunctionXOfferFirstTitle: "whatDoesJunctionXOfferFirstTitle", + whatDoesJunctionXOfferFirstBody: "whatDoesJunctionXOfferFirstBody", + whatDoesJunctionXOfferSecondTitle: "whatDoesJunctionXOfferSecondTitle", + whatDoesJunctionXOfferSecondBody: "whatDoesJunctionXOfferSecondBody", + whatDoesJunctionXOfferThirdTitle: "whatDoesJunctionXOfferThirdTitle", + whatDoesJunctionXOfferThirdBody: "whatDoesJunctionXOfferThirdBody", + whatDoesJunctionXOfferFourthTitle: "whatDoesJunctionXOfferFourthTitle", + whatDoesJunctionXOfferFourthBody: "whatDoesJunctionXOfferFourthBody", + organiserPageBottomContent: "organiserPageBottomContent", + interestedInOrganisingTitle: "interestedInOrganisingTitle", + interestedInOrganisingSubtitle: "interestedInOrganisingSubtitle", + interestedInOrganisingBody: "interestedInOrganisingBody", }; export default CONTENT_KEYS;