adding toastr nice

This commit is contained in:
Arjun Patel
2022-01-14 16:54:53 -08:00
parent 5bda645dae
commit ba88e7af27
3 changed files with 27 additions and 9 deletions
+13 -1
View File
@@ -5,15 +5,27 @@ import { BsThreeDots } from "react-icons/bs";
import { useTeamDashboardContext } from "../../contexts/teamDashboardContext";
import { UserStatus } from "../../models/user";
import { useState } from "react";
import { toast } from "react-hot-toast";
import { TeamMemberRole } from "../../models/teamMember";
export default function TeamVoiceLine() {
const router = useRouter();
const { teamid } = router.query;
const { team, user, userTeamMember } = useTeamDashboardContext();
const { teamMembers } = useTeamDashboardContext();
const [loading, setLoading] = useState<Boolean>(true);
//listeners for all teammates' status
async function handleAdminRoute() {
if (userTeamMember.role == TeamMemberRole.admin) {
router.push("/teams/" + teamid + "/admin");
return;
}
toast.error("You are not a team admin!");
}
function statusBubble(status: UserStatus) {
console.log(status);
@@ -118,7 +130,7 @@ export default function TeamVoiceLine() {
</span>
<button
onClick={() => router.push("/team/" + teamid + "/admin")}
onClick={handleAdminRoute}
className="bg-gray-300 bg-opacity-25 p-2 ml-auto rounded hover:bg-opacity-40"
>
<FaPlus className="text-lg text-white" />