Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/hng 28 floating footer cookie consent component #197

Merged
43 changes: 43 additions & 0 deletions app/components/ui/footerCookieConsent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { Button } from "./button";

const FooterCookieConsent: React.FC = () => {
const handleAccept = () => {
console.log("Cookie consent accepted");
};

const handleReject = () => {
console.log("Cookie consent rejected");
};

const handleSettings = () => {
console.log("Cookie settings opened");
};

return (
<div className="fixed bottom-0 w-full bg-white text-gray-900 border-t border-gray-200 p-6">
<div className="flex flex-col md:flex-row items-start md:justify-between md:items-center space-y-4 md:space-y-0 md:space-x-4">
<p className="text-sm text-left flex-1 flex flex-col">
<span className="font-bold text-sm sm:text-xl">We Value your Privacy</span>
<span className="text-xs sm:text-base">
Our website uses cookies to enhance your browsing experience,
provide personalized content, and analyze site traffic. By clicking
"Accept All", you consent to our use of cookies.
</span>
</p>
<div className="grid grid-cols-2 gap-2 place-content-center sm:grid-cols-3">
<Button variant="outline" onClick={handleSettings}>
Cookies Settings
</Button>
<Button variant="destructive" onClick={handleReject}>
Reject All
</Button>
<Button variant="destructive" onClick={handleAccept}>
Accept All Cookies
</Button>
</div>
</div>
</div>
);
};

export default FooterCookieConsent;