From ad48584cee5fc014a91663ecc803abe2d5576aa0 Mon Sep 17 00:00:00 2001 From: Soumyadas15 Date: Sat, 9 Mar 2024 12:10:43 +0530 Subject: [PATCH] Minor tweak --- app/api/phases/route.ts | 2 +- components/navbar/Notifications.tsx | 62 ++++++++++++++--------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/app/api/phases/route.ts b/app/api/phases/route.ts index bb60d38..73f7011 100644 --- a/app/api/phases/route.ts +++ b/app/api/phases/route.ts @@ -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(); diff --git a/components/navbar/Notifications.tsx b/components/navbar/Notifications.tsx index c6f7830..4924cfb 100644 --- a/components/navbar/Notifications.tsx +++ b/components/navbar/Notifications.tsx @@ -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; @@ -20,38 +20,36 @@ export const Notifications = ({ count }: NotificationProps) => { return ( -
- - - - {(count !== 0) ? ( -
- {count} -
+ + + + {(count !== 0) ? ( +
+ {count} +
+ ) : ( +
+ )} +
+ + + Notifications + + + + {notifications.length === 0 ? ( + + No notifications + ) : ( -
- )} -
- - - Notifications - - - - {notifications.length === 0 ? ( - - No notifications + notifications.map((notification: any, index: number) => ( + + - ) : ( - notifications.map((notification: any, index: number) => ( - - - - )) - )} - - -
-
+ )) + )} + + + ); };