-
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.
- Loading branch information
Showing
2 changed files
with
25 additions
and
16 deletions.
There are no files selected for viewing
39 changes: 24 additions & 15 deletions
39
checkers-app/src/components/dashboard/PendingMsgAlert.tsx
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,29 +1,38 @@ | ||
import { Alert } from "@material-tailwind/react"; | ||
import { EnvelopeIcon } from "@heroicons/react/20/solid"; | ||
import { BellAlertIcon } from "@heroicons/react/20/solid"; | ||
import { useNavigate } from "react-router-dom"; | ||
|
||
//true for pending messages, fale for update on pending VOTE | ||
//true for pending messages, false for update on pending VOTE | ||
export default function PendingMessageAlert({ | ||
hasPending, | ||
pendingCount, | ||
}: { | ||
hasPending: boolean; | ||
pendingCount: number; | ||
}) { | ||
const navigate = useNavigate(); | ||
|
||
const handleAlertClick = () => { | ||
navigate("/votes"); | ||
}; | ||
|
||
return ( | ||
<Alert | ||
icon={ | ||
hasPending ? ( | ||
<EnvelopeIcon className="h-6 w-6 text-highlight-color" /> | ||
) : ( | ||
<BellAlertIcon className="h-6 w-6 text-highlight-color" /> | ||
) | ||
} | ||
className="rounded items-center border-l-4 border-highlight-color bg-[highlight-color]/5 font-medium text-highlight-color shadow-md" | ||
> | ||
{hasPending | ||
? `${pendingCount} pending message(s) yet to vote!` | ||
: `${"TBD"} Crowd Vote updates!`} | ||
</Alert> | ||
<div onClick={handleAlertClick} className="cursor-pointer"> | ||
<Alert | ||
icon={ | ||
hasPending ? ( | ||
<EnvelopeIcon className="h-6 w-6 text-highlight-color" /> | ||
) : ( | ||
<BellAlertIcon className="h-6 w-6 text-highlight-color" /> | ||
) | ||
} | ||
className="rounded items-center border-l-4 border-highlight-color bg-[highlight-color]/5 font-medium text-highlight-color shadow-md" | ||
> | ||
{hasPending | ||
? `${pendingCount} pending message(s) yet to vote!` | ||
: `${"TBD"} Crowd Vote updates!`} | ||
</Alert> | ||
</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