Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jime #202

Merged
merged 2 commits into from
Oct 11, 2023
Merged

Jime #202

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions uniEmpleos/src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import React, { useState } from "react"
import { useStoreon } from "storeon/react"
import PropTypes from "prop-types"
import { FaBars, FaTimes } from "react-icons/fa"
import {AiOutlineLogout} from "react-icons/ai"
import { LuLogOut } from "react-icons/lu"
import Logo from "../Logo/Logo"
import Button from "../Button/Button"
import "./header.css"
import { navigate } from "../../store"

Expand Down Expand Up @@ -48,7 +47,7 @@ export const Header = () => {
<a href="/postulaciones">Postulaciones</a>
</div>
<div className="buttonLogoutMobile" onClick={handleClick}>
<AiOutlineLogout size={30} style={{ color: "#000" }} />
<LuLogOut size={30} style={{ color: "#000" }} />
</div>
</div>
)
Expand All @@ -62,7 +61,7 @@ export const Header = () => {
<a href="/chat">Chat</a>
</div>
<div className="buttonLogoutMobile" onClick={handleClick}>
<AiOutlineLogout size={30} style={{ color: "#000" }} />
<LuLogOut size={30} style={{ color: "#000" }} />
</div>
</div>
)
Expand All @@ -75,7 +74,7 @@ export const Header = () => {
<a href="/profile">Perfil</a>
</div>
<div className="buttonLogoutMobile" onClick={handleClick}>
<AiOutlineLogout size={30} style={{ color: "#000" }} />
<LuLogOut size={30} style={{ color: "#000" }} />
</div>
</div>
)
Expand Down
1 change: 0 additions & 1 deletion uniEmpleos/src/components/Header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ button.buttonlogo:focus{
}

.container {
max-width: 1100px;
margin: 0 auto;
padding: 0 15px;
display: flex;
Expand Down
12 changes: 8 additions & 4 deletions uniEmpleos/src/components/InfoStudent/InfoStudent.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@
justify-content: center;
align-items: center;
flex-direction: row;
background-color: #a08ae5;
color: #333333;
background-color: #8c6fd454;
gap: 20px;
border-radius: 10px;
padding: 0;
}

.button:hover {
cursor: pointer;
border: 2px solid #8c6fd4;
background-color: #8c6fd4;
border: none;
transition: background-color 0.3s, color 0.3s;
}

Expand Down Expand Up @@ -66,17 +67,20 @@
flex-direction: column;
overflow: auto;
scroll-behavior: smooth;
justify-content: center;
}

.name {
font-size: 18px;
font-weight: 700;
color: #fff;
color: #333333;
margin-bottom: 10px;
text-align: left;
}

.university {
font-size: 16px;
font-weight: 400;
color: #fff;
color: #333333;
text-align: left;
}
2 changes: 1 addition & 1 deletion uniEmpleos/src/components/InfoTab/InfoTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const InfoTab = ({
<div className={styles.button}>
<Button label={labelbutton} onClick={onClick} />
{verPostulantes && (
<Button label="Ver postulantes" onClick={verPostulantes} />
<Button label="Ver postulantes" onClick={verPostulantes}backgroundColor={"#a08ae5"}/>
)}
</div>
</div>
Expand Down
17 changes: 14 additions & 3 deletions uniEmpleos/src/components/InfoTab/InfoTab.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
display: flex;
flex-direction: column;
border-radius: 10px;
background-color: #fff;
background-color: #333333;
color: #fff;
margin-bottom: 20px;
border: 1px solid #d6d6d6;
padding: 20px;
Expand All @@ -27,21 +28,31 @@
}

.container p, h3{
color: #000;
color: #f5f5f5;
font-size: 16px;
text-transform: capitalize;
}

.containerinfomain h3{
font-size: 18px;
font-weight: 700;
margin-bottom: 10px;
border-radius: 10px;
background: #f8f8ef;
padding: 10px;
}

.button {
display: flex;
flex-direction: row;
gap: 10px;
}

@media screen and (max-width: 768px){
.container{
width: 100%;
}
.containerinfosecond{
flex-direction: column;
gap: 20px;
}
}
47 changes: 34 additions & 13 deletions uniEmpleos/src/pages/OfferDetails/OfferDetails.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from "react"
import Select from "react-select"
import { useStoreon } from "storeon/react"
import Joi from "joi"
import { useQuill } from "react-quilljs"
Expand Down Expand Up @@ -29,7 +30,7 @@ const OfferDetails = ({ id }) => {
const [salario, setSalario] = useState("")
const [puesto, setPuesto] = useState("")
const [detalles, setDetalles] = useState("")
const [carrera, setCarrera] = useState([])
const [carrera, setCarrera] = useState("")
const [carreras, setCarreras] = useState([])
const { quill, quillRef } = useQuill()
const [warning, setWarning] = useState(false)
Expand Down Expand Up @@ -63,13 +64,16 @@ const OfferDetails = ({ id }) => {
setSalario(dataa[i].salario)
setRequisitos(dataa[i].requisitos)
setDetalles(dataa[i].descripcion)
if (dataa[i].id_carreras !== null) {
setCarrera(dataa[i].id_carreras.map((num) => num.toString()))
if (
dataa[i].id_carreras !== null &&
dataa[i].id_carreras.length > 0
) {
setCarrera(dataa[i].id_carreras[0].toString()) // usar el primer elemento del array
} else {
setCarrera(["1"])
setCarrera("1") // o cualquier valor predeterminado que desees
}
} else {
console.log("not changing", id)
console.log(carrera)
}
}
}
Expand All @@ -92,7 +96,7 @@ const OfferDetails = ({ id }) => {
descripcion: details,
requisitos,
salario: parseFloat(salario),
id_carreras: carrera,
id_carreras: [carrera],
})
if (apiResponse.status === 200) {
navigate("/postulacionempresa")
Expand All @@ -118,10 +122,7 @@ const OfferDetails = ({ id }) => {
}

const handleCarrera = (e) => {
const selectedOptions = Array.from(e.target.selectedOptions).map(
(option) => option.value
)
setCarrera(selectedOptions)
setCarrera(e.value.toString())
}

const handleInputsValue = (e) => {
Expand Down Expand Up @@ -214,9 +215,29 @@ const OfferDetails = ({ id }) => {
</div>
<div className={styles.inputContainer}>
<span>Carrera</span>
<DropDown
opciones={carreras}
value={carrera}
<Select
styles={{
control: (baseStyles, state) => ({
...baseStyles,
borderColor: state.isFocused ? "#a08ae5" : "grey",
color: "black",
}),
option: (baseStyles) => ({
...baseStyles,
color: "black",
}),
}}
name="carrera"
theme={(theme) => ({
...theme,
colors: {
...theme.colors,
primary25: "#94bd0f",
primary: "#a08ae5",
},
})}
options={carreras}
value={carreras.find((option) => option.value === carrera)}
onChange={handleCarrera}
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions uniEmpleos/src/pages/PostulantesPage/PostulantesPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const PostulantesPage = ({ id }) => {
style={typeError}
close={() => setWarning(false)}
/>
<h1>Postulantes</h1>
<div className={style.infoStudentContainer}>
{response.data ? (
response.data.map((postulante) => (
Expand Down
16 changes: 12 additions & 4 deletions uniEmpleos/src/pages/PostulantesPage/PostulantesPage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@
height: 100%;
}

.mainContainer h1{
font-weight: 700;
margin-bottom: 20px;
color: #333333;
text-align: left;
padding: 20px;
}

.infoStudentContainer {
display: flex;
flex-direction: row;
width: 100%;
flex-wrap: wrap;
justify-content: center;
align-content: flex-start
justify-content: start;
gap: 30px;
margin-top: 20px;
padding: 10px;
}

.sinPostulantes {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
.containerinfoprincipal{
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
justify-content: start;
gap: 30px;
margin-top: 20px;
padding: 10px;
}

@media screen and (max-width: 768px){
.containerinfoprincipal{
justify-content: center;
}
}
33 changes: 28 additions & 5 deletions uniEmpleos/src/pages/nuevaOferta/NewOffer.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { useEffect, useState } from "react"
import Select from "react-select"
import { useStoreon } from "storeon/react"
import { useQuill } from "react-quilljs"
import style from "./NewOffer.module.css"
import { Header } from "../../components/Header/Header"
import Button from "../../components/Button/Button"
Expand All @@ -8,7 +10,6 @@ import TextArea from "../../components/textAreaAutosize/TextAreaAuto"
import DropDown from "../../components/dropDown/DropDown"
import { navigate } from "../../store"
import useApi from "../../Hooks/useApi"
import { useQuill } from "react-quilljs"
import "react-quill/dist/quill.snow.css"
import Popup from "../../components/Popup/Popup"

Expand Down Expand Up @@ -58,7 +59,7 @@ const Postulacion = () => {
}

const handleCarrera = (e) => {
setCarrera(e.target.value)
setCarrera(e.value)
}

const handleInputsValue = (e) => {
Expand Down Expand Up @@ -132,12 +133,34 @@ const Postulacion = () => {
</div>
<div className={style.inputContainer}>
<span>Carrera</span>
<DropDown
opciones={carreras}
value={carrera}
<Select
styles={{
control: (baseStyles, state) => ({
...baseStyles,
borderColor: state.isFocused ? "#a08ae5" : "grey",
color: "black",
}),
option: (baseStyles) => ({
...baseStyles,
color: "black",
}),
}}
name="carrera"
theme={(theme) => ({
...theme,
colors: {
...theme.colors,
primary25: "#94bd0f",
primary: "#a08ae5",
},
})}
defaultValue={carrera}
options={carreras}
value={carreras.find((option) => option.label === carrera)}
onChange={handleCarrera}
/>
</div>

<div className={style.inputContainer}>
<span>Requisitos</span>
<TextArea
Expand Down