Skip to content

Commit

Permalink
sin Foto
Browse files Browse the repository at this point in the history
Se retiro la opcion de ingresar una foto al momento de registrar un nuevo usuario, ya sea empresa o estudiante
  • Loading branch information
angelcast2002 committed Oct 11, 2023
1 parent 0353d2d commit 8c4320e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 59 deletions.
29 changes: 1 addition & 28 deletions uniEmpleos/src/pages/SignUpEmpresa/SignUpEmpresa.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@ import ComponentInput from "../../components/Input/Input"
import TextArea from "../../components/textAreaAutosize/TextAreaAuto"
import Button from "../../components/Button/Button"
import { navigate } from "../../store"
import ImageUploader from "../../components/ImageUploader/ImageUploader"
import Popup from "../../components/Popup/Popup"
import useIsImage from "../../Hooks/useIsImage"
import useApi from "../../Hooks/useApi"

const SignUpEmpresa = () => {
const isImage = useIsImage()
const api = useApi()

const [nombre, setNombre] = useState("")
const [correo, setCorreo] = useState("")
const [detalles, setDetalles] = useState("")
const [telefono, setTelefono] = useState("")
const [password, setPassword] = useState("")
const [uploadedImage, setUploadedImage] = useState("")
const [warning, setWarning] = useState(false)
const [error, setError] = useState("")
const [showPassword, setShowPassword] = useState(false)
Expand Down Expand Up @@ -70,7 +66,7 @@ const SignUpEmpresa = () => {
correo,
telefono,
contra: password,
foto: uploadedImage,
foto: "",
})
if (apiResponse.status === 200) {
setTypeError(3)
Expand All @@ -91,17 +87,6 @@ const SignUpEmpresa = () => {
}
}

const handleUploadFile = (UploadedImage) => {
const fileType = isImage(UploadedImage)
if (fileType) {
setUploadedImage(UploadedImage)
} else {
setTypeError(2)
setError("El archivo debe ser una imagen")
setWarning(true)
}
}

const handlePassword = () => {
setShowPassword(!showPassword)
}
Expand Down Expand Up @@ -159,18 +144,6 @@ const SignUpEmpresa = () => {
isOpen={showPassword}
/>
</div>
<div className={style.inputSubContainer}>
<span>Foto de perfil</span>
<div className={style.imageUploaderContainer}>
<ImageUploader
onImageUpload={handleUploadFile}
image={uploadedImage}
width="30px"
height="30px"
placeholderImage="/images/pfp.svg"
/>
</div>
</div>
<div className={style.inputTextArea}>
<span>Detalles</span>
<TextArea
Expand Down
33 changes: 2 additions & 31 deletions uniEmpleos/src/pages/SignUpEstudiante/SignUpEstudiante.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import React, { useEffect, useState } from "react"
import Select from "react-select"
import makeAnimated from "react-select/animated"
import style from "./SignUpEstudiante.module.css"
import ComponentInput from "../../components/Input/Input"
import Button from "../../components/Button/Button"
import { navigate } from "../../store"
import API_URL from "../../api"
import DropDown from "../../components/dropDown/DropDown"
import ImageUploader from "../../components/ImageUploader/ImageUploader"
import Popup from "../../components/Popup/Popup"
import useIsImage from "../../Hooks/useIsImage"
import useApi from "../../Hooks/useApi"

const SignUpEstudiante = () => {
const isImage = useIsImage()
const api = useApi()

const [nombre, setNombre] = useState("")
Expand All @@ -31,7 +26,6 @@ const SignUpEstudiante = () => {
const [error, setError] = useState("")

const [carreras, setCarreras] = useState([])
const [uploadedImage, setUploadedImage] = useState("")
const [showPassword, setShowPassword] = useState(false)
const [typeError, setTypeError] = useState(1)

Expand Down Expand Up @@ -153,8 +147,8 @@ const SignUpEstudiante = () => {
telefono,
carrera: carreraId,
semestre: parseInt(semestre, 10),
cv: " ",
foto: uploadedImage,
cv: "",
foto: "",
contra: password,
universidad,
})
Expand All @@ -177,17 +171,6 @@ const SignUpEstudiante = () => {
}
}

const handleUploadFile = (image) => {
const fileType = isImage(image)
if (fileType) {
setUploadedImage(image)
} else {
setTypeError(2)
setError("El archivo debe ser una imagen")
setWarning(true)
}
}

return (
<div className={style.signUpCointainer}>
<Popup
Expand Down Expand Up @@ -338,18 +321,6 @@ const SignUpEstudiante = () => {
onChange={handleSemestre}
/>
</div>
<div className={style.inputSubContainerDataGroup1}>
<span>Foto de perfil</span>
<div className={style.imageUploaderContainer}>
<ImageUploader
onImageUpload={handleUploadFile}
image={uploadedImage}
width="30px"
height="30px"
placeholderImage="/images/pfp.svg"
/>
</div>
</div>
</div>
<div className={style.buttonContainer}>
<Button label="Registrarse" onClick={handleSignUp} />
Expand Down

0 comments on commit 8c4320e

Please sign in to comment.