diff --git a/ui/src/components/layout/navbar/dept-account-icon.tsx b/ui/src/components/layout/navbar/dept-account-icon.tsx
new file mode 100644
index 00000000..7fbdc5f6
--- /dev/null
+++ b/ui/src/components/layout/navbar/dept-account-icon.tsx
@@ -0,0 +1,66 @@
+'use client';
+
+import { useState } from 'react';
+
+import DynamicModal from '@/components/modal/dynamic-modal';
+import { faUser, faSchool } from '@fortawesome/free-solid-svg-icons';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
+import User from '@/lib/access/user';
+import Role from '@/lib/access/role';
+
+const DeptAccountIcon = ({ currentUser }: { currentUser: User }) => {
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const openDepartmentalModal = () => {
+ setIsModalOpen(true);
+ };
+
+ const closeDepartmentalModal = () => {
+ setIsModalOpen(false);
+ };
+
+ return (
+ <>
+ {currentUser.roles.includes(Role.DEPARTMENTAL) && (
+
+
+
+
+
+
+
+
+
+
+ You are not in your personal account
+
+
+
+
+ )}
+ {isModalOpen && (
+
+ )}
+ >
+ );
+};
+
+export default DeptAccountIcon;
diff --git a/ui/src/components/layout/navbar/navbar-menu.tsx b/ui/src/components/layout/navbar/navbar-menu.tsx
index 483e605b..d7d4ec50 100644
--- a/ui/src/components/layout/navbar/navbar-menu.tsx
+++ b/ui/src/components/layout/navbar/navbar-menu.tsx
@@ -1,7 +1,7 @@
'use client';
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet';
-import { User } from 'next-cas-client';
+import User from '@/lib/access/user';
import Link from 'next/link';
import { NavbarLinks } from './navbar-links';
import { useState } from 'react';
diff --git a/ui/src/components/layout/navbar/navbar.tsx b/ui/src/components/layout/navbar/navbar.tsx
index 8382e4bc..e5a0e11d 100644
--- a/ui/src/components/layout/navbar/navbar.tsx
+++ b/ui/src/components/layout/navbar/navbar.tsx
@@ -6,9 +6,11 @@ import NavbarMenu from './navbar-menu';
import TimeoutModal from '@/components/modal/timeout-modal';
import { getUser } from '@/lib/access/user';
import Role from '@/lib/access/role';
+import DeptAccountIcon from '@/components/layout/navbar/dept-account-icon';
const Navbar = async () => {
const currentUser = await getUser();
+
return (
<>
@@ -34,6 +36,7 @@ const Navbar = async () => {
/>
+
{NavbarLinks.filter(
(navbarLink) =>
diff --git a/ui/src/components/modal/dynamic-modal.tsx b/ui/src/components/modal/dynamic-modal.tsx
index d8933183..9db92515 100644
--- a/ui/src/components/modal/dynamic-modal.tsx
+++ b/ui/src/components/modal/dynamic-modal.tsx
@@ -9,41 +9,34 @@ import {
AlertDialogFooter,
AlertDialogCancel
} from '@/components/ui/alert-dialog';
-import { ReactNode, useState } from 'react';
+import { ReactNode } from 'react';
import { Button } from '@/components/ui/button';
const DynamicModal = ({
open,
title,
body,
- buttons
+ buttons,
+ onClose
}: {
open: boolean;
title: string;
body: string;
buttons?: ReactNode[];
+ onClose: () => void;
}) => {
- const [openDynamicModal, setOpenDynamicModal] = useState(open);
-
- /**
- * Closes the modal.
- */
- const close = () => {
- setOpenDynamicModal(false);
- };
-
return (
-
+
{title}
{body}
- close()}>OK
+ OK
{/*Any buttons that should lead the user to a different page.*/}
{buttons?.map((button, index) => (
-