-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create the departmental account icon
- Loading branch information
Michelle Ho
committed
Nov 23, 2024
1 parent
c88af0e
commit f7a55fa
Showing
9 changed files
with
100 additions
and
20 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
|
||
import { School } from 'lucide-react'; | ||
import DynamicModal from '@/components/modal/dynamic-modal'; | ||
import { faUser } 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'; | ||
|
||
const DeptAccountIcon = ({ currentUser }: { currentUser: User }) => { | ||
const [isModalOpen, setIsModalOpen] = useState(false); | ||
const openDepartmentalModal = () => { | ||
setIsModalOpen(true); | ||
}; | ||
|
||
const closeDepartmentalModal = () => { | ||
setIsModalOpen(false); | ||
}; | ||
|
||
return ( | ||
<> | ||
{currentUser.uid == currentUser.uhUuid && ( | ||
<div | ||
onClick={openDepartmentalModal} | ||
className="flex justify-center items-center rounded-full | ||
h-[45px] w-[45px] bg-seafoam mx-auto relative lg:ml-24" | ||
> | ||
<TooltipProvider> | ||
<Tooltip> | ||
<TooltipTrigger> | ||
<FontAwesomeIcon aria-label="user" icon={faUser} width={14} height={16} /> | ||
<div | ||
className="bg-blue-background rounded-full flex justify-center | ||
items-center h-[20px] w-[25px] absolute left-7 bottom-0" | ||
> | ||
<School className="fill-white stroke-1 p-0.5" aria-label="school" /> | ||
</div> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p>You are not in your personal account</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
</TooltipProvider> | ||
</div> | ||
)} | ||
{isModalOpen && ( | ||
<DynamicModal | ||
open={isModalOpen} | ||
title={'Warning'} | ||
body={'You are not in your personal account.'} | ||
buttons={[]} | ||
onClose={closeDepartmentalModal} | ||
/> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default DeptAccountIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters