From 54a7ce0e8e262edde1bcab11c996ee951329efc9 Mon Sep 17 00:00:00 2001 From: 230419 <230419@epvc.pt> Date: Mon, 4 May 2026 22:28:44 +0100 Subject: [PATCH] notificacoes --- src/App.jsx | 83 ++++++++++++++++++++++++++++++++++++++++--------- src/lib/i18n.js | 10 ++++++ 2 files changed, 78 insertions(+), 15 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index e534ea3..15a8606 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1794,35 +1794,88 @@ export default function App() { {showNotificationsModal && (
setShowNotificationsModal(false)}> e.stopPropagation()}> -
-

{t('notificationsModal')}

- + {/* Header */} +
+
+

+ {t('notificationsModal')} +

+ {notifications.filter(n => !n.read).length > 0 && ( +

+ {notifications.filter(n => !n.read).length} {language === 'PT' ? 'nova(s)' : language === 'EN' ? 'new' : language === 'ES' ? 'nueva(s)' : language === 'FR' ? 'nouvelle(s)' : 'neue'} +

+ )} +
+
+ {notifications.filter(n => !n.read).length > 0 && ( + + )} + +
-
+ + {/* Lista */} +
{notifications.length === 0 ? ( -
{t('noNotifications')}
+
+ + {t('noNotifications')} +
) : notifications.map(notif => ( -
-
- +
+ {/* Ícone da Notificação */} +
+ {notif.type === 'look_copied' ? '✂️' : }
-
-

+ + {/* Conteúdo */} +

+

{notif.type === 'look_copied' && ( - <>O utilizador {notif.copiedByEmail} guardou o seu look "{notif.lookName}" {t('inTheirCloset')} + <> + {notif.copiedByEmail} + {' '}{t('lookCopiedBy')}{' '} + "{notif.lookName}" + )}

-

- {new Date(notif.createdAt).toLocaleDateString()} às {new Date(notif.createdAt).toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'})} +

+ {new Date(notif.createdAt).toLocaleDateString()} às {new Date(notif.createdAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}

+ + {/* Botão marcar como lida */} {!notif.read && ( - diff --git a/src/lib/i18n.js b/src/lib/i18n.js index 7502c5c..783b4ff 100644 --- a/src/lib/i18n.js +++ b/src/lib/i18n.js @@ -149,6 +149,8 @@ export const translations = { sendMessage: "Enviar Mensagem", notificationsModal: "Notificações", noNotifications: "Sem Notificações", + markAllRead: "Marcar todas como lidas", + lookCopiedBy: "copiou o seu look", userSavedLook: "guardou o seu look", inTheirCloset: "no armário dele!", sharedLookTitle: "Look Partilhado", @@ -321,6 +323,8 @@ export const translations = { sendMessage: "Send Message", notificationsModal: "Notifications", noNotifications: "No Notifications", + markAllRead: "Mark all as read", + lookCopiedBy: "copied your look", userSavedLook: "saved your look", inTheirCloset: "in their closet!", sharedLookTitle: "Shared Look", @@ -493,6 +497,8 @@ export const translations = { sendMessage: "Enviar Mensaje", notificationsModal: "Notificaciones", noNotifications: "Sin Notificaciones", + markAllRead: "Marcar todas como leídas", + lookCopiedBy: "copió tu look", userSavedLook: "guardó tu look", inTheirCloset: "en su armario!", sharedLookTitle: "Look Compartido", @@ -665,6 +671,8 @@ export const translations = { sendMessage: "Envoyer le Message", notificationsModal: "Notifications", noNotifications: "Aucune Notification", + markAllRead: "Tout marquer comme lu", + lookCopiedBy: "a copié votre look", userSavedLook: "a sauvegardé votre look", inTheirCloset: "dans son placard !", sharedLookTitle: "Look Partagé", @@ -837,6 +845,8 @@ export const translations = { sendMessage: "Nachricht Senden", notificationsModal: "Benachrichtigungen", noNotifications: "Keine Benachrichtigungen", + markAllRead: "Alle als gelesen markieren", + lookCopiedBy: "hat deinen Look kopiert", userSavedLook: "hat deinen Look gespeichert", inTheirCloset: "in seinem Schrank!", sharedLookTitle: "Geteilter Look",