Limite foto
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
.card {
|
||||
max-width: 90vw;
|
||||
width: 400px;
|
||||
height: 175px;
|
||||
height: 150px;
|
||||
margin: auto;
|
||||
padding: 0.5em;
|
||||
border-radius: 1em !important;
|
||||
|
||||
@@ -3,6 +3,8 @@ import "../Card.css";
|
||||
import { PrivateRoutes, PublicRoutes } from "../../../models/routes";
|
||||
import { useDeleteTeacher } from "../../../services/teacher.services";
|
||||
|
||||
const API_URL = process.env.REACT_APP_API_URL;
|
||||
|
||||
const CardProfesor = ({ profesor, edificioNombre, permissions }) => {
|
||||
const [showDialog, setShowDialog] = useState(false);
|
||||
const [confirmText, setConfirmText] = useState("");
|
||||
@@ -41,7 +43,14 @@ const CardProfesor = ({ profesor, edificioNombre, permissions }) => {
|
||||
alt={profesor.nombre}
|
||||
onClick={handleViewProfesor}
|
||||
/>
|
||||
) : null}
|
||||
) : (
|
||||
<img
|
||||
src={`${API_URL}/imagenes/${profesor.fotografia}`}
|
||||
className="imgProfe"
|
||||
alt={profesor.nombre}
|
||||
onClick={handleViewProfesor}
|
||||
/>
|
||||
)}
|
||||
|
||||
{permissions ? (
|
||||
<div
|
||||
|
||||
@@ -140,7 +140,7 @@ const FormProfesor = () => {
|
||||
let imageUrl = "";
|
||||
|
||||
if (fotoBase64) {
|
||||
imageUrl = await uploadImage(fotoBase64, nombre);
|
||||
imageUrl = await uploadImage(fotoBase64, id_usuario);
|
||||
}
|
||||
|
||||
const updatedDatosAcademicos = datosAcademicos.map(dato => ({
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
margin-bottom: 20px;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.foto {
|
||||
@@ -27,7 +28,7 @@
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
background-color: white;
|
||||
margin: 20px auto;
|
||||
margin: 0 auto 10px auto;
|
||||
width: 800px;
|
||||
max-width: 90vw;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import {
|
||||
useTeacher,
|
||||
} from "../../../services/teacher.services";
|
||||
|
||||
const API_URL = process.env.REACT_APP_API_URL;
|
||||
|
||||
const defaultImage =
|
||||
"https://static.vecteezy.com/system/resources/thumbnails/020/765/399/small_2x/default-profile-account-unknown-icon-black-silhouette-free-vector.jpg";
|
||||
|
||||
@@ -97,7 +99,13 @@ const PerfilProfesor = () => {
|
||||
<div className="foto-nombre">
|
||||
{fotoProfesor && fotoProfesor.startsWith("http") ? (
|
||||
<img src={fotoProfesor} alt={profesor.nombre} className="foto" />
|
||||
) : null}
|
||||
) : (
|
||||
<img
|
||||
src={`${API_URL}/imagenes/${profesor.fotografia}`}
|
||||
alt={profesor.nombre}
|
||||
className="foto"
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="info">
|
||||
<div className="nombre">
|
||||
@@ -134,7 +142,7 @@ const PerfilProfesor = () => {
|
||||
</div>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>Grado Máximo:</strong>
|
||||
<strong>Grado Máximo:</strong>
|
||||
{profesor.datosAcademicos.length > 0 ? (
|
||||
profesor.datosAcademicos[0].grado_maximo ? (
|
||||
<>{profesor.datosAcademicos[0].grado_maximo}</>
|
||||
@@ -240,7 +248,7 @@ const PerfilProfesor = () => {
|
||||
</div>
|
||||
|
||||
{showDialog && (
|
||||
<div className="dialog" style={{position:'fixed'}}>
|
||||
<div className="dialog" style={{ position: "fixed" }}>
|
||||
<p>
|
||||
¿Deseas eliminar al profesor <strong>{profesor.nombre}</strong>?
|
||||
</p>
|
||||
|
||||
@@ -77,7 +77,7 @@ export const useUploadImage = () => {
|
||||
}
|
||||
|
||||
const result = await response.json();
|
||||
return `${API_URL}${result.imageUrl}`;
|
||||
return result.imageUrl;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user