Skip to content

Commit

Permalink
Merge pull request #226 from markalbrand56/angel
Browse files Browse the repository at this point in the history
Perfil de administradores
  • Loading branch information
Kojimena authored Oct 31, 2023
2 parents 87ab045 + 91fdbe3 commit 1edab79
Show file tree
Hide file tree
Showing 21 changed files with 958 additions and 207 deletions.
8 changes: 7 additions & 1 deletion uniEmpleos/src/components/Button/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import React from "react"
import PropTypes from "prop-types"
import style from "./Button.module.css"

const Button = ({ label, backgroundColor, textColor, onClick, noborder }) => (
const Button = ({
label,
backgroundColor,
textColor,
onClick,
noborder,
}) => (
<div className={style.buttonContainer}>
<button
type="button"
Expand Down
14 changes: 8 additions & 6 deletions uniEmpleos/src/components/InfoStudent/InfoStudent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ const InfoStudent = ({
<img className={style.pfp} src={pfp} alt={`${nombre} ${apellido}`} />
</div>
<div className={style.infoContainer}>
<span className={style.name}>{`${nombre} ${apellido}`}</span>
{apellido ? (
<span className={style.name}>{`${nombre} ${apellido}`}</span>
) : (
<span className={style.name}>{`${nombre}`}</span>
)}
{universidad && (
<span className={style.university}>{universidad}</span>
)}
{showState && (
<div className={style.stateContainer}>
<span>Estado:</span>
<span
style={state ? { color: "#FF0000" } : { color: "#00FF00" }}
>
{`${state}`}
<span style={state ? { color: "#FF0000" } : { color: "#000" }}>
{state ? "Suspendido" : "Activo"}
</span>
</div>
)}
Expand All @@ -40,7 +42,7 @@ const InfoStudent = ({

InfoStudent.propTypes = {
nombre: PropTypes.string.isRequired,
apellido: PropTypes.string.isRequired,
apellido: PropTypes.string,
universidad: PropTypes.string,
pfp: PropTypes.string.isRequired,
onClick: PropTypes.func.isRequired,
Expand Down
52 changes: 52 additions & 0 deletions uniEmpleos/src/components/PublicProfile/PublicProfileAdmin.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from "react"
import style from "./PublicProfileAdmin.module.css"
import { BiUser } from "react-icons/bi"
import { HiOutlineMailOpen } from "react-icons/hi"
import Button from "../Button/Button"
const PublicProfileAdmin = ({
name,
lastName,
mail,
pfp,
suspended,
funcSuspended,
funcDelete,
}) => {
return (
<div className={style.mainContainer}>
<div className={style.pfpContainer}>
<img className={style.pfp} src={pfp} alt={`${name}`} />
</div>
<div className={style.infoContainer}>
<div className={style.nameContainer}>
<BiUser size={30} />
{lastName ? (
<span className={style.name}>{`${name} ${lastName}`}</span>
) : (
<span className={style.name}>{name}</span>
)}
</div>
<div className={style.mailContainer}>
<HiOutlineMailOpen size={30} />
<span className={style.info}>{mail}</span>
</div>
<div className={style.suspendedContainer}>
<Button
label={suspended ? "Activar" : "Suspender"}
backgroundColor={suspended ? "#00FF00" : "#FF0000"}
textColor="#FFFFFF"
onClick={funcSuspended}
/>
<Button
label="Eliminar"
backgroundColor="#FF0000"
textColor="#FFFFFF"
onClick={funcDelete}
/>
</div>
</div>
</div>
)
}

export default PublicProfileAdmin
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
.mainContainer {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: calc(100% - 40px);
height: calc(100% - 40px);
color: #000;
gap: 10%;
padding: 20px;
}

.pfpContainer {
display: flex;
align-items: center;
justify-content: end;
height: 80%;
width: 50%;
}

.pfp {
display: flex;
align-items: center;
justify-content: center;
width: 60%;
height: 80%;
object-fit: cover;
border-radius: 10px;
box-shadow: #00000040 0 54px 55px, #0000001f 0 -12px 30px, #0000001f 0 4px 6px, #0000002b 0 12px 13px, #00000017 0 -3px 5px;
}

.infoContainer {
display: flex;
flex-direction: column;
padding: 15px;
height: calc(100% - 30px);
align-items: flex-start;
justify-content: center;
width: calc(50% - 30px);
gap: 20px;
}

.infoContainer > * {
display: flex;
flex-direction: row;
gap: 20px;
align-items: center;
justify-content: center;
}

.infoContainer > div > span {
font-size: 20px;
color: #333;
text-align: center;
}

.suspendedContainer {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}

@media (max-width: 767px) {

.mainContainer {
flex-direction: column;
}

.pfpContainer {
justify-content: center;
align-items: center;
width: 70%;
height: 50%;
}

.infoContainer {
width: 100%;
height: 50%;
align-items: center;
justify-content: center;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import react, { useEffect, useState } from "react"
import React, { useEffect, useState } from "react"
import useApi from "../../Hooks/useApi"
import Popup from "../../components/Popup/Popup"
import style from "./AdminShowPostulationDetails.module.css"
Expand Down Expand Up @@ -65,15 +65,15 @@ const AdminShowPostulationDetails = ({ id }) => {
}
}, [quill, detalles])

const onclickAccept = async () => {
const onclickAccept = async (e) => {
const variableApi = `/admins/delete/offers?id_oferta=${id}`
const apiResponse = await api.handleRequest("DELETE", variableApi)
if (apiResponse.status === 200) {
setTypeError(3)
setError("Oferta eliminada con éxito")
setWarning(true)
setTimeout(() => {
navigate("/profileadmin")
navigate(`/publicProfileAdminEnterprise/${e}`)
}, 5000)
} else {
setTypeError(1)
Expand All @@ -82,8 +82,8 @@ const AdminShowPostulationDetails = ({ id }) => {
}
}

const handleReturn = () => {
navigate("/profileadmin")
const handleReturn = (e) => {
navigate(`/publicProfileAdminEnterprise/${e}`)
}

return (
Expand All @@ -100,7 +100,9 @@ const AdminShowPostulationDetails = ({ id }) => {
<div className={style.titleContainer}>
<h4>{data.offer.puesto}</h4>
<button
onClick={onclickAccept}
onClick={() => {
onclickAccept(data.company.correo)
}}
type="button"
className={style.deleteButton}
>
Expand Down Expand Up @@ -132,7 +134,9 @@ const AdminShowPostulationDetails = ({ id }) => {
<Button
label="Regresar"
backgroundColor="transparet"
onClick={handleReturn}
onClick={() => {
handleReturn(data.company.correo)
}}
/>
</div>
</div>
Expand Down
Loading

0 comments on commit 1edab79

Please sign in to comment.