diff --git a/app/components/ui/CookieConsent/CookieConsent.module.css b/app/components/ui/CookieConsent/CookieConsent.module.css new file mode 100644 index 00000000..4c7b1f64 --- /dev/null +++ b/app/components/ui/CookieConsent/CookieConsent.module.css @@ -0,0 +1,47 @@ +.CookieConsent{ + background: rgba(20, 20, 20, 1); + +} + +*{ + box-sizing: border-box; +} +.modal{ + max-width: 791px; + height: auto; + width: 50%; + max-height: 90vh; + overflow-y: auto; +} + +.modal_content{ + padding: 0px 24px; +} + +.roboto{ + font-family: Roboto; + font-size: 24px; + font-weight: 700; + line-height: 28.13px; + text-align: left; +} + +.inter{ + font-family: Inter; + font-size: 16px; + font-weight: 400; + line-height: 19.36px; + text-align: left; +} + +.cookie_info{ + display: flex; + justify-content: space-between; + padding: 24px 0px; + + +} + +.hidden{ + display: none; +} diff --git a/app/components/ui/CookieConsent/CookieConsent.tsx b/app/components/ui/CookieConsent/CookieConsent.tsx new file mode 100644 index 00000000..745b8847 --- /dev/null +++ b/app/components/ui/CookieConsent/CookieConsent.tsx @@ -0,0 +1,69 @@ +import React, {useState} from "react"; +import styles from './CookieConsent.module.css'; +import CookieSettings from "./CookieSettings"; + +export default function CookieConsent(){ + const [isExpanded, setIsExpanded] = useState(false); + + const toggleExpand = () => { + setIsExpanded(!isExpanded); + }; + + return ( +
+
+
+

Customize cookies

+

+ Cookies are small text files that are stored on your device when you visit websites. + They are used to remember information about you, such as your login details, preferences, and browsing history. + Cookies help enhance your browsing experience by allowing websites to remember your actions and preferences over time, + ensuring that you don’t have to re-enter information each time you visit a site. + They also help website owners analyze traffic and user behavior to improve their services. + Read our Privacy Policy for more details +

+
+
+
+
+

Strictly necessary

+
{ + if (e.key === 'Enter' || e.key === ' ') { + toggleExpand(); + e.preventDefault() + } + }} + aria-expanded={isExpanded} + > + {isExpanded +
+
+

+ These cookies are essential for the website to function properly. + They enable basic functions like page navigation, secure login, + and access to protected areas of the site. Without these cookies, + the website cannot perform properly. +

+
+
+

Always Enabled

+
+
+ +
+ +
+
+
+
+ + ) +} \ No newline at end of file diff --git a/app/components/ui/CookieConsent/CookieSettings.tsx b/app/components/ui/CookieConsent/CookieSettings.tsx new file mode 100644 index 00000000..bd57ae38 --- /dev/null +++ b/app/components/ui/CookieConsent/CookieSettings.tsx @@ -0,0 +1,118 @@ +import React, { useState } from 'react'; + +interface CookieSetting { + title: string; + description: string; + id: string; +} + +interface CookiePreferenceProps extends CookieSetting { + isExpanded: boolean; + onToggle: () => void; + isChecked: boolean; + onCheckChange: (checked: boolean) => void; +} + +const CookiePreference: React.FC = ({ + title, + description, + isExpanded, + onToggle, + id, + isChecked, + onCheckChange +}) => { + return ( +
+
+
+
+

{title}

+
{ + if (e.key === 'Enter' || e.key === ' ') { + onToggle(); + e.preventDefault() + } + }} + aria-expanded={isExpanded} + > + {isExpanded +
+
+

+ {description} +

+
+
+ +
+
+ ); +}; + +const CookieSettings: React.FC = () => { + const [expandedIndex, setExpandedIndex] = useState(null); + const [checkedStates, setCheckedStates] = useState<{ [key: string]: boolean }>({}); + + const cookieSettings = [ + { + title: "Performance Cookies", + id: "pc", + description: "These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site." + }, + { + title: "Functional Cookies", + id: "fc", + description: "These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages." + }, + { + title: "Targeting Cookies", + id: "tc", + description: "These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites." + } + ]; + + const handleToggle = (index: number) => { + setExpandedIndex(expandedIndex === index ? null : index); + }; + + const handleCheckChange = (id: string, checked: boolean) => { + setCheckedStates(prev => ({ ...prev, [id]: checked })); + }; + + return ( +
+ {cookieSettings.map((setting, index) => ( + handleToggle(index)} + id={setting.id} + isChecked={checkedStates[setting.id] || false} + onCheckChange={(checked) => handleCheckChange(setting.id, checked)} + /> + ))} +
+ ); +}; + +export default CookieSettings; \ No newline at end of file diff --git a/app/routes/_index.tsx b/app/routes/_index.tsx index 1eeb5b2f..21e04111 100644 --- a/app/routes/_index.tsx +++ b/app/routes/_index.tsx @@ -1,6 +1,7 @@ import type { MetaFunction } from "@remix-run/node"; import { Button } from "~/components/ui/button"; import CardPlatform from "~/components/ui/card/card-platform"; +import CookieConsent from "~/components/ui/CookieConsent/CookieConsent"; export const meta: MetaFunction = () => { return [ @@ -54,6 +55,7 @@ export default function Index() { + ); }