From e74619ae19971eafd77db6a5bce107ce9e823c8e Mon Sep 17 00:00:00 2001 From: IO Date: Sun, 18 Aug 2024 23:16:01 -0600 Subject: [PATCH] default image --- .env | 2 +- .../Card/CardProfesores/CardProfesor.js | 29 +++++++++---------- .../Teacher/PerfilProfesor/PerfilProfesor.js | 12 +++++++- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.env b/.env index f2dfb88..70a1f07 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -REACT_APP_API_URL=https://venus.acatlan.unam.mx/directorio_test +REACT_APP_API_URL=http://192.168.100.7:3000 REACT_APP_PORT=3001 diff --git a/src/components/Card/CardProfesores/CardProfesor.js b/src/components/Card/CardProfesores/CardProfesor.js index e5ad580..af25730 100644 --- a/src/components/Card/CardProfesores/CardProfesor.js +++ b/src/components/Card/CardProfesores/CardProfesor.js @@ -11,7 +11,6 @@ const CardProfesor = ({ profesor, edificioNombre, permissions }) => { const { deleteTeacher } = useDeleteTeacher(); const defaultImage = "https://static.vecteezy.com/system/resources/thumbnails/020/765/399/small_2x/default-profile-account-unknown-icon-black-silhouette-free-vector.jpg"; - const fotoProfesor = profesor.fotografia || defaultImage; const handleDeleteClick = () => { setShowDialog(true); @@ -33,24 +32,22 @@ const CardProfesor = ({ profesor, edificioNombre, permissions }) => { window.location.href = `${PublicRoutes.DATAPROFESOR}${profesor.id_profesor}`; }; + const handleImageError = (e) => { + e.target.src = defaultImage; + }; + return (
- {fotoProfesor && fotoProfesor.startsWith("http") ? ( - {profesor.nombre} - ) : ( - {profesor.nombre} - )} + {profesor.nombre} {permissions ? (
{ }); }; + const handleImageError = (e) => { + e.target.src = defaultImage; + }; + return (
@@ -98,12 +102,18 @@ const PerfilProfesor = () => {
{fotoProfesor && fotoProfesor.startsWith("http") ? ( - {profesor.nombre} + {profesor.nombre} ) : ( {profesor.nombre} )}