mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-01 21:32:35 +02:00
Add cookie settings
This commit is contained in:
31
src/components/CookieSettingsButton.tsx
Normal file
31
src/components/CookieSettingsButton.tsx
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import { cn } from '../lib/classname';
|
||||||
|
import { Cookie } from 'lucide-react';
|
||||||
|
|
||||||
|
export function CookieSettingsButton() {
|
||||||
|
return (
|
||||||
|
<div className="mt-12 flex items-center justify-start">
|
||||||
|
<button
|
||||||
|
onClick={() => {
|
||||||
|
// @ts-ignore
|
||||||
|
const ot: any = window.OneTrust;
|
||||||
|
// @ts-ignore
|
||||||
|
const optanon: any = window.Optanon;
|
||||||
|
|
||||||
|
if (ot) {
|
||||||
|
ot.ToggleInfoDisplay();
|
||||||
|
} else if (optanon) {
|
||||||
|
optanon.ToggleInfoDisplay();
|
||||||
|
} else {
|
||||||
|
console.warn('OneTrust/Optanon SDK not found or not loaded yet.');
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
className={cn(
|
||||||
|
'flex items-center gap-2 rounded-md bg-slate-800/80 px-3 py-1.5 text-sm text-gray-400 transition-colors hover:bg-slate-700 hover:text-white',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Cookie className="h-4 w-4" />
|
||||||
|
Cookie Settings
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
import AstroIcon from './AstroIcon.astro';
|
import AstroIcon from './AstroIcon.astro';
|
||||||
import Icon from './AstroIcon.astro';
|
import Icon from './AstroIcon.astro';
|
||||||
|
import { CookieSettingsButton } from './CookieSettingsButton';
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class='bg-slate-900 py-6 pb-10 text-white sm:py-16'>
|
<div class='bg-slate-900 py-6 pb-10 text-white sm:py-16'>
|
||||||
@@ -35,7 +36,7 @@ import Icon from './AstroIcon.astro';
|
|||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class='flex flex-col justify-between gap-8 lg:gap-2 lg:flex-row'>
|
<div class='flex flex-col justify-between gap-8 lg:flex-row lg:gap-2'>
|
||||||
<div class='max-w-[425px]'>
|
<div class='max-w-[425px]'>
|
||||||
<p class='text-md flex items-center'>
|
<p class='text-md flex items-center'>
|
||||||
<a
|
<a
|
||||||
@@ -56,8 +57,9 @@ import Icon from './AstroIcon.astro';
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p class='my-4 text-slate-300/60'>
|
<p class='my-4 text-slate-300/60'>
|
||||||
Community created roadmaps, best practices, projects, articles, resources and journeys to help
|
Community created roadmaps, best practices, projects, articles,
|
||||||
you choose your path and grow in your career.
|
resources and journeys to help you choose your path and grow in your
|
||||||
|
career.
|
||||||
</p>
|
</p>
|
||||||
<div class='text-sm text-gray-400'>
|
<div class='text-sm text-gray-400'>
|
||||||
<p>
|
<p>
|
||||||
@@ -73,7 +75,10 @@ import Icon from './AstroIcon.astro';
|
|||||||
class='hover:text-white'
|
class='hover:text-white'
|
||||||
target='_blank'
|
target='_blank'
|
||||||
>
|
>
|
||||||
<AstroIcon icon='linkedin-2' class='inline-block h-5 w-5 fill-current' />
|
<AstroIcon
|
||||||
|
icon='linkedin-2'
|
||||||
|
class='inline-block h-5 w-5 fill-current'
|
||||||
|
/>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
aria-label='Subscribe to YouTube channel'
|
aria-label='Subscribe to YouTube channel'
|
||||||
@@ -114,14 +119,15 @@ import Icon from './AstroIcon.astro';
|
|||||||
<img
|
<img
|
||||||
src='/images/tns-sm.png'
|
src='/images/tns-sm.png'
|
||||||
alt='ThewNewStack'
|
alt='ThewNewStack'
|
||||||
class='my-1.5 mr-auto lg:ml-auto lg:mr-0'
|
class='my-1.5 mr-auto lg:mr-0 lg:ml-auto'
|
||||||
width='200'
|
width='200'
|
||||||
height='24.8'
|
height='24.8'
|
||||||
loading="lazy"
|
loading='lazy'
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
<p class='my-4 text-slate-300/60'>
|
<p class='my-4 text-slate-300/60'>
|
||||||
The top DevOps resource for Kubernetes, cloud-native computing, and large-scale development and deployment.
|
The top DevOps resource for Kubernetes, cloud-native computing, and
|
||||||
|
large-scale development and deployment.
|
||||||
</p>
|
</p>
|
||||||
<div class='text-sm text-gray-400'>
|
<div class='text-sm text-gray-400'>
|
||||||
<p>
|
<p>
|
||||||
@@ -146,5 +152,7 @@ import Icon from './AstroIcon.astro';
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<CookieSettingsButton client:load />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user