Skip to content

Commit

Permalink
feat: banner for recruitment
Browse files Browse the repository at this point in the history
  • Loading branch information
Gobot1234 committed Oct 25, 2024
1 parent 8ce49c6 commit 2cc25fb
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions apps/forge/src/components/navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
import { useState, useCallback } from "react";
import AppNav from "@/components/navbar/appNav";
import AppSwitcher from "@/components/navbar/appSwitcher";
import { ThemeSwitcher } from "@/components/navbar/themeSwitcher";
import { UserNav } from "@/components/navbar/userNav";
import { Menu, X } from "lucide-react";
import { getCookie, setCookie } from "@/services/cookies/cookieService";
import { Badge } from "@ui/components/ui/badge";
import { Button } from "@ui/components/ui/button";
import { Menu, X, XIcon } from "lucide-react";
import { useCallback, useState } from "react";

function NotificationBanner() {
const [dismissed, setDismissed] = useState(getCookie("notification_dismissed") === "true" || false);

if (dismissed) return null;

const handleDismiss = () => {
setDismissed(true);
// Set the cookie to remember the dismissal
setCookie("notification_dismissed", "true");
};

return (
<div className="relative w-full">
<Badge className="h-6 w-full rounded-none flex items-center justify-center text-sm font-medium gap-0.5 overflow-hidden hover:bg-primary">
The iForge is recruiting!
<Button
variant="hyperlink"
className="text-red-50"
onClick={() =>
(document.location =
"https://docs.google.com/forms/d/e/1FAIpQLSfRTTBDKCd_kZkVLBHW2LI_GHKkYTwyLWcLkqu7E5AemxJKaw/viewform")
}
>
Apply here
</Button>
<XIcon className="cursor-pointer" onClick={handleDismiss} />
</Badge>
</div>
);
}

export default function NavBar() {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
Expand Down Expand Up @@ -48,6 +81,7 @@ export default function NavBar() {
</div>
</div>
)}
<NotificationBanner />
</div>
);
}

0 comments on commit 2cc25fb

Please sign in to comment.