source: jobvista-frontend/src/views/job_advertisements/JobAdDetails.js@ b248810

main
Last change on this file since b248810 was 28b3398, checked in by 223021 <daniel.ilievski.2@…>, 3 weeks ago

Implemented job application functionality, added job advertisement filtering and replaced text areas with editors

  • Property mode set to 100644
File size: 4.4 KB
Line 
1import "./JobAdDetails.css"
2import {useEffect, useState} from "react";
3import {useDispatch, useSelector} from "react-redux";
4import {JobAdvertisementActions} from "../../redux/actions/jobAdvertisementActions";
5import {useParams} from "react-router";
6import Roles from "../../enumerations/Roles";
7import JobType from "../../enumerations/JobType";
8import EmploymentStatus from "../../enumerations/EmploymentStatus";
9import {formatRelativeTime} from "../../utils/utils";
10import {AddJobAdModal} from "./AddJobAdModal";
11import {ApplyToJobAdModal} from "../applications/ApplyToJobAdModal";
12
13
14export const JobAdDetails = () => {
15 const dispatch = useDispatch();
16 const [jobAd, setJobAd] = useState("")
17 const [recruiterDetails, setRecruiterDetails] = useState("");
18 const [role, setRole] = useState("")
19 const {id} = useParams();
20 const auth = useSelector(state => state.auth.currentUser);
21
22 useEffect(() => {
23 setRole(auth.role)
24 }, [auth])
25
26
27 useEffect(() => {
28 JobAdvertisementActions.fetchJobAdvertisementById(id, (success, response) => {
29 if (success) {
30 setJobAd(response.data)
31 JobAdvertisementActions.fetchRecruiterDetailsById(response.data.recruiterId, (successAgain, responseAgain) => {
32 if(successAgain) {
33 setRecruiterDetails(responseAgain.data)
34 }
35 })
36 }
37 });
38 }, [])
39 return (<div className="container">
40 <div className="row">
41 <div className="col-md-9">
42 <div className="details-wrap">
43
44 <div className="title">
45 <h2>{jobAd.title} </h2>
46 <span className="job-type"> {jobAd.jobType===JobType.JOB ? "Job" : "Internship"}</span>
47 {!jobAd.active && <span className="expired">Expired</span>}
48 </div>
49
50 <p className="details-head-info">
51 <span><b>{jobAd.recruiterName}</b></span> • <span>{jobAd.industry}</span> • <span>{formatRelativeTime(jobAd.postedOn)}</span>
52 </p>
53
54 <p><i className="fa-solid fa-money-check-dollar"></i> <span>Hourly rate: ${jobAd.startingSalary}</span></p>
55 <p><i className="fa-solid fa-briefcase"></i> Employment status: {jobAd.employmentStatus==="FULL_TIME" ? "Full-time" : "Part-time"}</p>
56 <p><i className="fa-solid fa-calendar-days"></i> Active until: {new Date(jobAd.activeUntil).toLocaleString('default', { day: 'numeric', month: 'long', year: 'numeric' })}</p>
57
58 <h4>About the job</h4>
59 {jobAd.description && (
60 <p dangerouslySetInnerHTML={{ __html: jobAd.description.replace(/\n/g, "<br>") }}></p>
61 )}
62 <ApplyToJobAdModal jobAd={jobAd} role={role}/>
63
64 </div>
65 </div>
66 <div className="col-md-3">
67 <div className="details-wrap">
68 <h3>{jobAd.recruiterName}</h3>
69
70 {/*TO DO - AFTER IMPLEMENTING FORM FOR UPDATING PERSONAL INFO*/}
71 <h4>About the company</h4>
72 <p>
73 For over two decades, we have been harnessing technology to drive meaningful change. Working side by side with leading brands, we build strategies, products and solutions tailored to unique needs –regardless of industry, region or scale. By combining world-class engineering, industry expertise and a people-centric mindset, we consult and partner with our customers to create technological solutions that drive innovation and transform businesses.
74 <br/><br/>
75 From ideation to production, we support our customers with bespoke solutions across various industries, including payments, insurance, finance and banking, technology, media and entertainment, telecommunications, retail and consumer goods, supply chain and logistics, healthcare and life sciences, energy and resources, government, automotive and travel.
76
77 </p>
78 <p><span><i className="fa-solid fa-envelope"></i> {recruiterDetails.email}</span> • <span>
79 <i className="fa-solid fa-phone"></i> {recruiterDetails.phoneNumber}</span>
80 </p>
81 </div>
82 </div>
83
84 </div>
85
86
87
88 </div>)
89}
Note: See TracBrowser for help on using the repository browser.