Ignore:
Timestamp:
06/17/24 21:59:14 (2 weeks ago)
Author:
223021 <daniel.ilievski.2@…>
Branches:
main
Children:
08f82ec
Parents:
b248810
Message:

Added an edit profile page for both job seekers and recruiters, where they can upload profile pictures/company logos and edit their profile data. Added profile page specifically for recruiters. Refactored existing code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jobvista-frontend/src/views/job_advertisements/JobAdDetails.js

    rb248810 rbefb988  
    1010import {AddJobAdModal} from "./AddJobAdModal";
    1111import {ApplyToJobAdModal} from "../applications/ApplyToJobAdModal";
     12import {Link} from "react-router-dom";
     13import {RecruiterActions} from "../../redux/actions/recruiterActions";
    1214
    1315
     
    2022    const auth = useSelector(state => state.auth.currentUser);
    2123
     24    let logosState = useSelector(state => state.images.logos)
     25    const [logoDispatched, setLogoDispatched] = useState(false)
     26    const [logoView, setLogoView] = useState(null);
     27
    2228    useEffect(() => {
    2329        setRole(auth.role)
    2430    }, [auth])
     31
     32    useEffect(() => {
     33        if (jobAd) {
     34            if (!logoDispatched && !logosState[jobAd.recruiterId]) {
     35                dispatch(RecruiterActions.downloadLogo(jobAd.recruiterId, (success, response) => {
     36                    if (success) {
     37                        setLogoView(response)
     38                        setLogoDispatched(true)
     39                    }
     40                }))
     41            } else {
     42                setLogoView(logosState[jobAd.recruiterId])
     43            }
     44
     45        }
     46
     47    }, [jobAd])
    2548
    2649
     
    4164            <div className="col-md-9">
    4265                <div className="details-wrap">
     66                    <div className="row">
     67                        <div className="col-md-9">
     68                            <div className="title">
     69                                <h2>{jobAd.title} </h2>
     70                                <span className="job-type"> {jobAd.jobType===JobType.JOB ? "Job" : "Internship"}</span>
     71                                {!jobAd.active && <span className="expired">Expired</span>}
     72                            </div>
    4373
    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>}
     74                            <p className="details-head-info">
     75                                <span><b>{jobAd.recruiterName}</b></span> • <span>{jobAd.industry}</span> • <span>{formatRelativeTime(jobAd.postedOn)}</span>
     76                            </p>
     77
     78                            <p><i className="fa-solid fa-money-check-dollar"></i> <span>Hourly rate: ${jobAd.startingSalary}</span></p>
     79                            <p><i className="fa-solid fa-briefcase"></i> Employment status: {jobAd.employmentStatus==="FULL_TIME" ? "Full-time" : "Part-time"}</p>
     80                            <p><i className="fa-solid fa-calendar-days"></i> Active until: {new Date(jobAd.activeUntil).toLocaleString('default', { day: 'numeric', month: 'long',  year: 'numeric' })}</p>
     81
     82                        </div>
     83                        <div className="col-md-3">
     84                            {jobAd.recruiterId &&
     85                                <>
     86                                    <img
     87                                        // loading gif
     88                                        src={logosState[jobAd.recruiterId]}
     89                                        alt=""
     90                                        width={200} height={200}
     91                                    />
     92                                </>
     93                            }
     94
     95                        </div>
    4896                    </div>
    4997
    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>
    5798
    5899                    <h4>About the job</h4>
     
    66107            <div className="col-md-3">
    67108                <div className="details-wrap">
    68                     <h3>{jobAd.recruiterName}</h3>
     109                    <Link className="recruiter-link" to={`/recruiters/${jobAd.recruiterId}`}>{jobAd.recruiterName} </Link>
    69110
    70                     {/*TO DO - AFTER IMPLEMENTING FORM FOR UPDATING PERSONAL INFO*/}
    71111                    <h4>About the company</h4>
    72112                    <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.
     113                        {recruiterDetails.companyDescription
     114                            ? recruiterDetails.companyDescription.length > 710
     115                                ? `${recruiterDetails.companyDescription.substring(0, 710)}...`
     116                                : recruiterDetails.companyDescription
     117                            : "There is no info about this company yet."
     118                        }
     119                    </p>
    76120
     121                    <p>
     122                        <i className="fa-solid fa-envelope"></i> <span className="span-about"> {recruiterDetails.contactEmail}</span> <br/>
     123                        <i className="fa-solid fa-phone"></i> <span className="span-about"> {recruiterDetails.contactPhoneNumber}</span> <br/>
     124                        {recruiterDetails.receptionist && <><i className="fa-solid fa-user-tie"></i> <span className="span-about"> {recruiterDetails.receptionist}</span> </>}
    77125                    </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>
     126
     127                    <div className="d-flex justify-content-center mt-4">
     128                        <Link className="card-button" to={`/recruiters/${jobAd.recruiterId}`}>Read more </Link>
     129                    </div>
    81130                </div>
    82131            </div>
Note: See TracChangeset for help on using the changeset viewer.