diff --git a/src/pages/NotificationsList/index.tsx b/src/pages/NotificationsList/index.tsx index 8cbf4bb..cd3e5dc 100644 --- a/src/pages/NotificationsList/index.tsx +++ b/src/pages/NotificationsList/index.tsx @@ -45,28 +45,32 @@ export default function NotificationsList() : JSX.Element { ); const notificationRenderer = (notification: (NotificationModels)): JSX.Element => { + // eslint-disable-next-line camelcase + const fromName = notification.from.data()?.full_name || 'Usuário deletado'; switch (notification.type) { case NotificationType.adoptionInterest: { + const animalName = notification.animal.data()?.name || 'Animal deletado'; return ( { navigation.navigate('AnimalDetails', { animalUID: notification.animal.id }); }} > - {notification.from.data().full_name} está interessado no seu pet {notification.animal.data().name} + {fromName} está interessado no seu pet {animalName} ); } case NotificationType.adoptionRefused: { + const animalName = notification.animal.data()?.name || 'Animal deletado'; return ( { navigation.navigate('AnimalDetails', { animalUID: notification.animal.id }); }} > - {notification.from.data().full_name} recusou sua solicitação ao pet {notification.animal.data().name} + {fromName} recusou sua solicitação ao pet {animalName} ); }