Skip to content

Commit

Permalink
Minor tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Soumyadas15 committed Mar 9, 2024
1 parent 60c6c71 commit ad48584
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/api/phases/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export async function POST(request: Request) {
}

if (!(currentUser.role === "ADMIN" || currentUser.role === "MANAGER")) {
return new Response('You dont have', { status: 404 });
return new Response('You dont have the required permissions', { status: 404 });
}

const body = await request.json();
Expand Down
62 changes: 30 additions & 32 deletions components/navbar/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { Bell } from "lucide-react";
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../ui/dropdown";
import { useEffect } from "react";
import { NotificationItem } from "./NotificationItem";
import { Badge } from "../ui/badge";
import { NotificationItem } from "./NotificationItem";

interface NotificationProps {
user: any;
Expand All @@ -20,38 +20,36 @@ export const Notifications = ({
count
}: NotificationProps) => {
return (
<div className="relative">
<DropdownMenu>
<DropdownMenuTrigger>
<Bell/>
{(count !== 0) ? (
<div className="absolute pl-1 pr-1 bg-red-600 rounded-full bottom-5 left-2 flex items-center justify-center text-white font-semibold text-sm">
{count}
</div>
<DropdownMenu>
<DropdownMenuTrigger>
<Bell/>
{(count !== 0) ? (
<div className="absolute pl-1 pr-1 bg-red-600 rounded-full bottom-5 left-2 flex items-center justify-center text-white font-semibold text-sm">
{count}
</div>
) : (
<div></div>
)}
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56 max-w-56 bg-white rounded-[5px] dark:border-none dark:bg-black">
<DropdownMenuLabel>
Notifications
</DropdownMenuLabel>
<DropdownMenuSeparator></DropdownMenuSeparator>
<DropdownMenuGroup>
{notifications.length === 0 ? (
<DropdownMenuItem className="text-neutral-600 dark:text-neutral-300">
No notifications
</DropdownMenuItem>
) : (
<div></div>
)}
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56 max-w-56 bg-white rounded-[5px] dark:border-none dark:bg-black">
<DropdownMenuLabel>
Notifications
</DropdownMenuLabel>
<DropdownMenuSeparator></DropdownMenuSeparator>
<DropdownMenuGroup>
{notifications.length === 0 ? (
<DropdownMenuItem className="text-neutral-600 dark:text-neutral-300">
No notifications
notifications.map((notification: any, index: number) => (
<DropdownMenuItem key={index}>
<NotificationItem notification={notification} />
</DropdownMenuItem>
) : (
notifications.map((notification: any, index: number) => (
<DropdownMenuItem key={index}>
<NotificationItem notification={notification} />
</DropdownMenuItem>
))
)}
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
</div>
))
)}
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
);
};

0 comments on commit ad48584

Please sign in to comment.