From 49c5886f62e9ef112c1ced2562f33a949ad273ef Mon Sep 17 00:00:00 2001 From: Abhinav Roy Date: Wed, 10 May 2023 16:33:33 +0530 Subject: [PATCH] cookes added --- package.json | 1 + pages/index.tsx | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 140150d3..a0758088 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "notion-types": "^6.12.6", "notion-utils": "^6.12.9", "react": "17.0.2", + "react-cookie-consent": "^8.0.1", "react-dom": "17.0.2", "react-error-boundary": "^3.1.4", "react-fast-marquee": "^1.3.1", diff --git a/pages/index.tsx b/pages/index.tsx index 5dc16631..029385fd 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -33,6 +33,7 @@ import { IconCommunity, IconGlobe, IconTransaction } from "@shm/Icons"; import { Helmet } from "react-helmet"; import { relative } from "path"; import Head from "next/head"; +import CookieConsent, { Cookies, getCookieConsentValue } from "react-cookie-consent"; const LandingPage = ({ news }: InferGetStaticPropsType): React.ReactNode => { const { t: pageTranslation } = useTranslation("page-home"); @@ -43,6 +44,10 @@ const LandingPage = ({ news }: InferGetStaticPropsType): { Icon: IconTransaction, title: "est-transaction-cost" }, { Icon: IconGlobe, title: "min-validators" }, ]; + + const getCookieValue = () => { + console.log(getCookieConsentValue()); + }; return ( <> {/* Hero section */} @@ -125,7 +130,20 @@ const LandingPage = ({ news }: InferGetStaticPropsType): } /> - + { + getCookieValue(); + }} + enableDeclineButton + onDecline={() => { + alert("nay!"); + }} + > + We value your privacy +
+ We use cookies to enhance the user experience, serve personalised ads or content , and + analise our traffic. by clicking i Understand you consent to our use if cookies +