-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hmt 117 frontend implementation email to all participants (#182)
Co-authored-by: Anthony <[email protected]> Co-authored-by: Burton Jong <[email protected]>
- Loading branch information
1 parent
893d8e7
commit 4d20234
Showing
7 changed files
with
160 additions
and
29 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { useEffect } from "react"; | ||
|
||
type Props = { closeModal: () => void }; | ||
|
||
export default function EmailAllParticipants({ closeModal }: Props) { | ||
useEffect(() => { | ||
const handleOutsideClick = (e: MouseEvent) => { | ||
const modal = document.querySelector(".modal-container"); | ||
if (modal && !modal.contains(e.target as Node)) { | ||
closeModal(); | ||
} | ||
}; | ||
|
||
document.addEventListener("mousedown", handleOutsideClick); | ||
return () => { | ||
document.removeEventListener("mousedown", handleOutsideClick); | ||
}; | ||
}, [closeModal]); | ||
return ( | ||
<div className="flex size-full items-center justify-center"> | ||
<div className="modal-container max-w-2xl rounded-3xl bg-light-grey shadow-2xl"> | ||
<div className="flex items-center justify-between rounded-t-3xl bg-awesomer-purple p-6"> | ||
<h2 className="text-lg font-semibold text-white"> | ||
Email All Participants | ||
</h2> | ||
<button | ||
onClick={closeModal} | ||
className="text-2xl text-white hover:text-gray-300" | ||
> | ||
× | ||
</button> | ||
</div> | ||
<form className="flex flex-col justify-center gap-6 p-6"> | ||
<div className="flex flex-row justify-between"> | ||
<div> | ||
<label className="text-md font-medium text-black">From:</label> | ||
<input | ||
type="text" | ||
value="Code The Change" | ||
readOnly | ||
className="rounded-md bg-gray-100 p-2 text-gray-500" | ||
/> | ||
</div> | ||
<div> | ||
<label className="text-md font-medium text-black">To:</label> | ||
<input | ||
type="text" | ||
value="All Participants" | ||
readOnly | ||
className="rounded-md bg-gray-100 p-2 text-gray-500" | ||
/> | ||
</div> | ||
</div> | ||
<div className="flex items-center justify-center gap-4"> | ||
<label className="text-md relative stroke-white font-bold text-black"> | ||
Subject: | ||
</label> | ||
<input | ||
type="text" | ||
placeholder="Enter subject here" | ||
className="w-3/4 rounded-md p-2 focus:ring-1 focus:ring-awesome-purple" | ||
/> | ||
</div> | ||
<div className="shadow-t-xl flex h-1/2 flex-col rounded-2xl bg-white shadow-lg shadow-awesomer-purple"> | ||
<textarea | ||
rows={6} | ||
placeholder="Enter your message here" | ||
className="rounded-2xl p-2 focus:ring-1 focus:ring-awesome-purple" | ||
/> | ||
</div> | ||
<div className="mt-8 flex items-center justify-center font-extrabold"> | ||
<button | ||
type="submit" | ||
className="w-32 rounded-3xl bg-awesomer-purple p-2 text-white shadow-lg ring-1 ring-white transition-transform duration-200 ease-in-out hover:-translate-y-1 hover:bg-awesomer-purple/90" | ||
> | ||
SEND | ||
</button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,22 +1,35 @@ | ||
import { GoBell } from "react-icons/go"; | ||
import { IoIosSearch } from "react-icons/io"; | ||
import { IoMailOutline } from "react-icons/io5"; | ||
import { PiUserCircleFill } from "react-icons/pi"; | ||
"use client"; | ||
|
||
import { useState } from "react"; | ||
|
||
import AdminNavTitle from "@/components/Dashboard/AdminNavTitle"; | ||
|
||
import EmailAllParticipants from "./EmailAllParticipants"; | ||
|
||
export default function TopNavBar() { | ||
const [isModalOpen, setIsModalOpen] = useState(false); // State to toggle the modal | ||
|
||
const toggleModal = () => { | ||
setIsModalOpen(!isModalOpen); // Toggle modal visibility | ||
}; | ||
return ( | ||
<> | ||
<div className=" flex w-full justify-between bg-white p-4 px-8 text-4xl font-semibold"> | ||
<AdminNavTitle /> | ||
<div className="flex flex-row items-center gap-4"> | ||
<IoIosSearch /> | ||
<GoBell /> | ||
<IoMailOutline /> | ||
<PiUserCircleFill size={64} /> | ||
<button | ||
onClick={toggleModal} | ||
className="rounded-lg p-2 text-lg shadow-lg ring-2 ring-awesome-purple transition-transform duration-200 ease-in-out hover:-translate-y-2 hover:bg-awesome-purple hover:ring-awesomer-purple" | ||
> | ||
Announce To All Participants | ||
</button> | ||
</div> | ||
</div> | ||
{isModalOpen && ( | ||
<div className="fixed inset-0 z-[1000] flex size-full bg-light-grey/40"> | ||
<EmailAllParticipants closeModal={toggleModal} /> | ||
</div> | ||
)} | ||
</> | ||
); | ||
} |
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