From 3a4519cb640fee59cdb4e6d9e3e9ddbcef46a37d Mon Sep 17 00:00:00 2001
From: Mo Tarbin <mhed.t91@gmail.com>
Date: Sun, 1 Sep 2024 14:11:08 -0400
Subject: Add CookiePermissionSnackbar component to Landing page, Better UI to
 selected dates

---
 src/views/Landing/CookiePermissionSnackbar.jsx | 40 ++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 src/views/Landing/CookiePermissionSnackbar.jsx

(limited to 'src/views/Landing/CookiePermissionSnackbar.jsx')

diff --git a/src/views/Landing/CookiePermissionSnackbar.jsx b/src/views/Landing/CookiePermissionSnackbar.jsx
new file mode 100644
index 0000000..e786794
--- /dev/null
+++ b/src/views/Landing/CookiePermissionSnackbar.jsx
@@ -0,0 +1,40 @@
+import { Button, Snackbar } from '@mui/joy'
+import Cookies from 'js-cookie'
+import { useEffect, useState } from 'react'
+
+const CookiePermissionSnackbar = () => {
+  useEffect(() => {
+    const cookiePermission = Cookies.get('cookies_permission')
+
+    if (cookiePermission !== 'true') {
+      setOpen(true)
+    }
+  }, [])
+
+  const [open, setOpen] = useState(false)
+  const handleClose = () => {
+    // Cookies.set('cookies_permission', 'true')
+    setOpen(false)
+  }
+
+  return (
+    <Snackbar
+      open={open}
+      anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
+      onClose={(event, reason) => {
+        if (reason === 'clickaway') {
+          return
+        }
+        // Cookies.set('cookies_permission', 'true')
+        handleClose()
+      }}
+    >
+      We use cookies to ensure you get the best experience on our website.
+      <Button variant='soft' onClick={handleClose}>
+        Accept
+      </Button>
+    </Snackbar>
+  )
+}
+
+export default CookiePermissionSnackbar
-- 
cgit 


From e6702663779136d91d6c73c4d4b319e1d0325142 Mon Sep 17 00:00:00 2001
From: Mo Tarbin <mhed.t91@gmail.com>
Date: Wed, 4 Sep 2024 23:13:44 -0400
Subject: Set cookies_permission to 'true' when closing
 CookiePermissionSnackbar

---
 src/views/Landing/CookiePermissionSnackbar.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/views/Landing/CookiePermissionSnackbar.jsx')

diff --git a/src/views/Landing/CookiePermissionSnackbar.jsx b/src/views/Landing/CookiePermissionSnackbar.jsx
index e786794..7fe3724 100644
--- a/src/views/Landing/CookiePermissionSnackbar.jsx
+++ b/src/views/Landing/CookiePermissionSnackbar.jsx
@@ -13,7 +13,7 @@ const CookiePermissionSnackbar = () => {
 
   const [open, setOpen] = useState(false)
   const handleClose = () => {
-    // Cookies.set('cookies_permission', 'true')
+    Cookies.set('cookies_permission', 'true')
     setOpen(false)
   }
 
-- 
cgit 

