Skip to content

Commit ab32d04

Browse files
committed
fix(web): resolve lint syntax parsing errors in NotificationBell
1 parent cba9403 commit ab32d04

1 file changed

Lines changed: 21 additions & 29 deletions

File tree

apps/web/components/NotificationBell.tsx

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { useEffect, useRef, useState } from "react";
4-
import { Bell, X } from "lucide-react";
4+
import { Bell } from "lucide-react";
55
import { useRouter } from "next/navigation";
66

77
import { useNotificationStore, Notification } from "@/store/notification.store";
@@ -16,9 +16,9 @@ export default function NotificationBell() {
1616

1717
const mountedRef = useRef(false);
1818

19-
useEffect(() => {
20-
mountedRef.current = true;
21-
}, []);
19+
useEffect(() => {
20+
mountedRef.current = true;
21+
}, []);
2222

2323
// Fetch notifications on mount if user is logged in
2424
useEffect(() => {
@@ -58,11 +58,6 @@ useEffect(() => {
5858
markAsRead(notification._id);
5959
}
6060

61-
// TEST ROUTER PUSH (Uncomment if needed)
62-
// console.log("🔥 TEST ROUTER PUSH");
63-
// router.push("/influencer-dashboard");
64-
// return;
65-
6661
const type = notification?.type?.toUpperCase();
6762

6863
if (type === "GIG_REQUEST") {
@@ -87,7 +82,6 @@ useEffect(() => {
8782

8883
} else {
8984
console.warn("❌ Unknown navigation type", notification);
90-
// Fallback
9185
setIsOpen(false);
9286
}
9387
};
@@ -131,26 +125,24 @@ useEffect(() => {
131125
)}
132126
</div>
133127

134-
<div className="max-h-[350px] sm:max-h-96 overflow-y-auto">
128+
<div
129+
className="max-h-[350px] sm:max-h-[420px] overflow-y-auto custom-scrollbar bg-slate-50/50"
130+
data-lenis-prevent
131+
>
135132
{loading && notifications.length === 0 ? (
136-
<div className="p-6 flex justify-center">
137-
<div className="w-5 h-5 border-2 border-[#059669] border-t-transparent rounded-full animate-spin"></div>
133+
<div className="p-10 flex justify-center">
134+
<div className="w-6 h-6 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin"></div>
138135
</div>
139-
</div>
140-
141-
<div
142-
className="flex-1 overflow-y-auto sm:max-h-[420px] custom-scrollbar bg-slate-50/50"
143-
data-lenis-prevent
144-
>
145-
{loading && notifications.length === 0 ? (
146-
<div className="p-10 flex justify-center">
147-
<div className="w-6 h-6 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin"></div>
136+
) : notifications.length === 0 ? (
137+
<div className="p-8 flex flex-col items-center justify-center text-center">
138+
<div className="w-12 h-12 bg-gray-50 rounded-full flex items-center justify-center mb-3">
139+
<Bell className="w-6 h-6 text-gray-300" />
148140
</div>
149141
<p className="text-sm text-gray-500 font-medium">No notifications yet</p>
150142
<p className="text-xs text-gray-400 mt-1">We&apos;ll let you know when something happens.</p>
151143
</div>
152144
) : (
153-
<ul className="divide-y divide-gray-50">
145+
<ul className="divide-y divide-gray-50 bg-white">
154146
{notifications.map((notification) => (
155147
<li
156148
key={notification._id}
@@ -171,13 +163,13 @@ useEffect(() => {
171163
{formatTime(notification.createdAt)}
172164
</p>
173165
</div>
174-
</li>
175-
))}
176-
</ul>
177-
)}
178-
</div>
166+
</div>
167+
</li>
168+
))}
169+
</ul>
170+
)}
179171
</div>
180-
</>
172+
</div>
181173
)}
182174
</div>
183175
);

0 commit comments

Comments
 (0)