@@ -4,6 +4,7 @@ import { useState, useEffect, useRef } from 'react';
44import { useAccount } from '@/contexts/auth/AccountContext' ;
55import { notificationService , Notification } from '@/lib/services/notification-service' ;
66import { useRouter } from 'next/navigation' ;
7+ import { getBadgeIcon } from '@/utils/constants/badges/assets' ;
78
89export const NotificationBell : React . FC = ( ) => {
910 const { account } = useAccount ( ) ;
@@ -138,6 +139,21 @@ export const NotificationBell: React.FC = () => {
138139 }
139140 } ;
140141
142+ const getBadgeNotificationColor = ( badgeId ?: string ) => {
143+ switch ( badgeId ) {
144+ case 'escrow_expert' :
145+ return 'bg-blue-500/20' ; // Blue for Escrow Expert
146+ case 'trust_guardian' :
147+ return 'bg-orange-500/20' ; // Orange for Trust Guardian
148+ case 'stellar_champion' :
149+ return 'bg-pink-500/20' ; // Pink for Stellar Champion
150+ case 'nexus_master' :
151+ return 'bg-green-500/20' ; // Green for Nexus Master
152+ default :
153+ return 'bg-gray-500/20' ; // Default gray
154+ }
155+ } ;
156+
141157 const formatTimeAgo = ( timestamp : any ) => {
142158 const now = new Date ( ) ;
143159 const notificationDate = timestamp . toDate ( ) ;
@@ -207,17 +223,12 @@ export const NotificationBell: React.FC = () => {
207223 < button
208224 key = { notification . id }
209225 onClick = { ( ) => handleNotificationClick ( notification ) }
210- className = { `w-full text-left p-3 rounded-lg border transition-all duration-200 hover:scale-[1.02] ${
211- notification . read
212- ? 'bg-white/5 border-white/10 opacity-60'
213- : `bg-gradient-to-br ${ getNotificationColor ( notification . type ) } `
214- } `}
226+ className = { `w-full text-left p-3 rounded-lg border transition-all duration-200 hover:scale-[1.02] ${ notification . read
227+ ? 'bg-white/5 border-white/10 opacity-60'
228+ : `bg-gradient-to-br ${ getNotificationColor ( notification . type ) } `
229+ } `}
215230 >
216231 < div className = 'flex items-start gap-3' >
217- { /* Icon */ }
218- < div className = 'text-2xl flex-shrink-0' >
219- { getNotificationIcon ( notification . type ) }
220- </ div >
221232
222233 { /* Content */ }
223234 < div className = 'flex-1 min-w-0' >
@@ -245,8 +256,15 @@ export const NotificationBell: React.FC = () => {
245256 ) }
246257 { /* Mostrar Insignia Ganada (NUEVO) */ }
247258 { notification . data ?. badgeName && (
248- < div className = 'inline-flex items-center gap-1 text-xs font-semibold text-purple-400 bg-purple-500/20 px-2 py-1 rounded' >
249- 🏅 { notification . data . badgeName }
259+ < div className = { `inline-flex items-center gap-1 text-xs font-semibold text-white ${ getBadgeNotificationColor ( notification . data . badgeId ) } px-2 py-1 rounded` } >
260+ { notification . data . badgeId ? (
261+ < span className = "w-4 h-4 flex items-center justify-center" >
262+ { getBadgeIcon ( notification . data . badgeId , 'w-4 h-4' ) }
263+ </ span >
264+ ) : (
265+ '🏅'
266+ ) }
267+ { notification . data . badgeName }
250268 </ div >
251269 ) }
252270 </ div >
0 commit comments