[28b3398] | 1 | import React, {useEffect, useState} from "react";
|
---|
[befb988] | 2 | import "../shared_css/Modal.css";
|
---|
[28b3398] | 3 |
|
---|
| 4 | import 'react-responsive-modal/styles.css';
|
---|
| 5 | import {Modal} from 'react-responsive-modal';
|
---|
| 6 | import Select from "react-select";
|
---|
| 7 |
|
---|
| 8 | //Validation
|
---|
| 9 | import * as yup from "yup";
|
---|
| 10 | import {yupResolver} from "@hookform/resolvers/yup";
|
---|
| 11 | import {Controller, useForm} from "react-hook-form";
|
---|
| 12 |
|
---|
| 13 |
|
---|
| 14 | import {employmentStatusOptions, industryOptions, jobTypeOptions} from "../selectOptions";
|
---|
| 15 | import {useDispatch, useSelector} from "react-redux";
|
---|
| 16 | import {JobAdvertisementActions} from "../../redux/actions/jobAdvertisementActions";
|
---|
| 17 | import Roles from "../../enumerations/Roles";
|
---|
| 18 | import {ApplicationActions} from "../../redux/actions/applicationActions";
|
---|
| 19 |
|
---|
| 20 |
|
---|
[befb988] | 21 | export const ApplicationDetailsModal = (props) => {
|
---|
[28b3398] | 22 | const {application} = props
|
---|
| 23 | const [modal, setModal] = useState(false);
|
---|
| 24 | const dispatch = useDispatch();
|
---|
| 25 | const auth = useSelector(state => state.auth.currentUser)
|
---|
| 26 | const [resumeUrl, setResumeUrl] = useState("");
|
---|
| 27 |
|
---|
| 28 | //const [resumeFile, setResumeFile] = useState(null);
|
---|
| 29 | const toggleModal = () => {
|
---|
| 30 | setModal(!modal);
|
---|
| 31 | };
|
---|
| 32 |
|
---|
| 33 | useEffect(() => {
|
---|
| 34 | if(application) {
|
---|
| 35 | dispatch(ApplicationActions.downloadResume(application.fileName, (success, response) => {
|
---|
| 36 | if(success) {
|
---|
| 37 | setResumeUrl(response);
|
---|
| 38 | }
|
---|
| 39 | }))
|
---|
| 40 | }
|
---|
| 41 | }, [application])
|
---|
| 42 |
|
---|
| 43 | return (<div className="modal-wrap">
|
---|
| 44 | <button onClick={toggleModal} className="application-button">View application</button>
|
---|
| 45 | <Modal open={modal} onClose={toggleModal} center >
|
---|
| 46 | <div className="head-modal">
|
---|
| 47 | <h3>{application.jobSeekerName}'s application for {application.jobAdTitle}</h3>
|
---|
| 48 | <i className="fa-solid fa-x btn-close-modal" onClick={toggleModal}></i>
|
---|
| 49 | </div>
|
---|
| 50 |
|
---|
| 51 | <div className="modal-content" >
|
---|
| 52 | <form>
|
---|
| 53 | <div className="row">
|
---|
| 54 | <div className="col-md-6">
|
---|
| 55 | <label className="label">Why are you interested in joining our company?</label>
|
---|
[befb988] | 56 | <textarea disabled type="text" defaultValue={application.questionAnswers[0]} disabled placeholder="Write your answer here..." className="application-textarea"/>
|
---|
[28b3398] | 57 |
|
---|
| 58 |
|
---|
| 59 | <label className="label">What makes you a good fit for this position?</label>
|
---|
[befb988] | 60 | <textarea disabled type="text" defaultValue={application.questionAnswers[1]} placeholder="Write your answer here..." className="application-textarea"/>
|
---|
[28b3398] | 61 |
|
---|
| 62 |
|
---|
| 63 | <label className="label">What do you hope to achieve in your first 6 months in this role?</label>
|
---|
[befb988] | 64 | <textarea disabled type="text" defaultValue={application.questionAnswers[2]} placeholder="Write your answer here..." className="application-textarea"/>
|
---|
[28b3398] | 65 |
|
---|
| 66 | </div>
|
---|
| 67 | <div className="col-md-6">
|
---|
| 68 | <label htmlFor="start">Curriculum vitae (CV)</label>
|
---|
| 69 | <br/>
|
---|
| 70 | <a className="resume-link" href={resumeUrl} target="_blank" rel="noopener noreferrer">{application.fileName}</a>
|
---|
| 71 | <br/>
|
---|
| 72 |
|
---|
| 73 | <br/>
|
---|
| 74 | <label className="label">Message to the recruiter</label>
|
---|
[befb988] | 75 | <textarea disabled type="text" defaultValue={application.message} placeholder="Optional..." className="application-textarea"/>
|
---|
[28b3398] | 76 |
|
---|
| 77 | </div>
|
---|
| 78 | </div>
|
---|
| 79 |
|
---|
| 80 | </form>
|
---|
| 81 | </div>
|
---|
| 82 | </Modal>
|
---|
| 83 | </div>)
|
---|
| 84 | } |
---|