Skip to content

Instantly share code, notes, and snippets.

View ESE-MONDAY's full-sized avatar
🎯
Focusing

Ese Monday ESE-MONDAY

🎯
Focusing
View GitHub Profile
@ESE-MONDAY
ESE-MONDAY / CookieConsent.tsx
Created November 13, 2023 16:22
Implementing a cookie consent pop-up
import React, {useState} from 'react'
//import useCookie hook from next-cookie
import { useCookie } from 'next-cookie';
import Link from 'next/link';
const CookiesConsent = () => {
const oneMonth = 30 * 24 * 60 * 60 * 1000;
// Expiration date of one month
const expirationDate = new Date(Date.now() + oneMonth);