-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #197 from markalbrand56/angel
Angel
- Loading branch information
Showing
13 changed files
with
492 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from "react" | ||
import PropTypes from "prop-types" | ||
import style from "./InfoStudent.module.css" | ||
|
||
const InfoStudent = ({ nombre, apellido, universidad, pfp, onClick }) => { | ||
return ( | ||
<div className={style.mainContainer}> | ||
<button type="button" className={style.button} onClick={onClick}> | ||
<div className={style.pfpContainer}> | ||
<img className={style.pfp} src={pfp} alt={`${nombre} ${apellido}`} /> | ||
</div> | ||
<div className={style.infoContainer}> | ||
<span className={style.name}>{`${nombre} ${apellido}`}</span> | ||
<span className={style.university}>{universidad}</span> | ||
</div> | ||
</button> | ||
</div> | ||
) | ||
} | ||
|
||
InfoStudent.propTypes = { | ||
nombre: PropTypes.string.isRequired, | ||
apellido: PropTypes.string.isRequired, | ||
universidad: PropTypes.string.isRequired, | ||
pfp: PropTypes.string.isRequired, | ||
onClick: PropTypes.func.isRequired, | ||
} | ||
|
||
export default InfoStudent |
82 changes: 82 additions & 0 deletions
82
uniEmpleos/src/components/InfoStudent/InfoStudent.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
.mainContainer { | ||
display: flex; | ||
background-color: transparent; | ||
width: calc(100% / 2 - 20px); | ||
height: 100px; | ||
padding: 10px; | ||
animation: aparecer 0.5s ease; | ||
} | ||
|
||
@keyframes aparecer { | ||
from { | ||
opacity: 0; | ||
transform: translateY(10px); | ||
} | ||
to { | ||
opacity: 1; | ||
transform: translateY(0px); | ||
} | ||
} | ||
|
||
.button { | ||
display: flex; | ||
width: 100%; | ||
height: 100%; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: row; | ||
background-color: #a08ae5; | ||
gap: 20px; | ||
border-radius: 10px; | ||
padding: 0; | ||
} | ||
|
||
.button:hover { | ||
cursor: pointer; | ||
background-color: #8c6fd4; | ||
border: none; | ||
transition: background-color 0.3s, color 0.3s; | ||
} | ||
|
||
.button:focus { | ||
border: none; | ||
} | ||
|
||
.pfpContainer { | ||
width: calc(25% - 20px); | ||
max-width: 80px; | ||
max-height: 80px; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.pfp { | ||
border-radius: 50%; | ||
background-color: transparent; | ||
width: 100%; | ||
height: 100%; | ||
object-fit: cover; | ||
object-position: center; | ||
} | ||
|
||
.infoContainer { | ||
width: calc(75% - 20px); | ||
height: 80%; | ||
display: flex; | ||
flex-direction: column; | ||
overflow: auto; | ||
scroll-behavior: smooth; | ||
} | ||
|
||
.name { | ||
font-size: 18px; | ||
font-weight: 700; | ||
color: #fff; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.university { | ||
font-size: 16px; | ||
font-weight: 400; | ||
color: #fff; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React, { useEffect, useState } from "react" | ||
import PropTypes from "prop-types" | ||
import useApi from "../../Hooks/useApi" | ||
import InfoStudent from "../../components/InfoStudent/InfoStudent" | ||
import style from "./PostulantesPage.module.css" | ||
import Popup from "../../components/Popup/Popup" | ||
import { Header } from "../../components/Header/Header" | ||
import { navigate } from "../../store" | ||
|
||
const PostulantesPage = ({ id }) => { | ||
const api = useApi() | ||
const [response, setResponse] = useState([]) | ||
const [warning, setWarning] = useState(false) | ||
const [error, setError] = useState("") | ||
const [typeError, setTypeError] = useState(1) | ||
|
||
const obtainPostulantes = async () => { | ||
const datos = await api.handleRequest("POST", "/offers/applicants", { | ||
id_oferta: parseInt(id, 10), | ||
}) | ||
if (datos.status === 200) { | ||
setResponse(datos) | ||
} else { | ||
setTypeError(1) | ||
setError("Error al obtener los postulantes") | ||
setWarning(true) | ||
} | ||
} | ||
|
||
useEffect(() => { | ||
obtainPostulantes() | ||
}, []) | ||
|
||
const handleClickUsuario = (idUsuario) => { | ||
navigate(`/publicprofile/${idUsuario}`) | ||
} | ||
|
||
return ( | ||
<div className={style.mainContainer}> | ||
<Header /> | ||
<Popup | ||
message={error} | ||
status={warning} | ||
style={typeError} | ||
close={() => setWarning(false)} | ||
/> | ||
<div className={style.infoStudentContainer}> | ||
{response.data ? ( | ||
response.data.map((postulante) => ( | ||
<InfoStudent | ||
nombre={postulante.nombre} | ||
apellido={postulante.apellido} | ||
universidad={postulante.universidad} | ||
pfp={postulante.foto} | ||
onClick={() => handleClickUsuario(postulante.id_estudiante)} | ||
/> | ||
)) | ||
) : ( | ||
<span className={style.sinPostulantes}>No hay postulantes</span> | ||
)} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
PostulantesPage.propTypes = { | ||
id: PropTypes.string.isRequired, | ||
} | ||
|
||
export default PostulantesPage |
19 changes: 19 additions & 0 deletions
19
uniEmpleos/src/pages/PostulantesPage/PostulantesPage.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.mainContainer { | ||
display: flex; | ||
flex-direction: column; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.infoStudentContainer { | ||
display: flex; | ||
flex-direction: row; | ||
width: 100%; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
align-content: flex-start | ||
} | ||
|
||
.sinPostulantes { | ||
color: #000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.