Skip to content

Commit 9f5fa5a

Browse files
committed
Improved styling, added status to pending jobs
1 parent b3dfaa7 commit 9f5fa5a

File tree

3 files changed

+68
-40
lines changed

3 files changed

+68
-40
lines changed

frontend/src/components/JobApply.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ const JobApply = () => {
2626
<div>
2727
{appliedJobs.length > 0 ? (
2828
<div>
29-
<Typography>Applied Jobs</Typography>
3029
{appliedJobs.map((appliedJob) => (
31-
<JobPost key={appliedJob.id} job={appliedJob.job} disabled={true} />
30+
<JobPost
31+
key={appliedJob.id}
32+
job={appliedJob.job}
33+
disabled={true}
34+
status={appliedJob.application_status.status}
35+
/>
3236
))}
3337
</div>
3438
) : (

frontend/src/components/JobPost.jsx

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import { useState } from "react";
33
import { Button, Typography } from "@mui/material";
4+
import { Label } from "../components/RecruiterApplicantsComponents";
45

56
import "../styles/JobPost.css";
67

@@ -15,6 +16,23 @@ function JobPost(props) {
1516
});
1617
};
1718

19+
const getStatusColor = (status) => {
20+
switch (status) {
21+
case "SUBMITTED":
22+
return "success";
23+
case "UNDER REVIEW":
24+
return "info";
25+
case "UNDERGOING FURTHER SCREENING":
26+
return "warning";
27+
case "REJECTED":
28+
return "error";
29+
case "OFFER SENT":
30+
return "offerSent";
31+
default:
32+
return "secondary";
33+
}
34+
};
35+
1836
const applyHandler = async () => {
1937
setApply(true);
2038
try {
@@ -68,19 +86,23 @@ function JobPost(props) {
6886
</Typography>
6987
);
7088
})}
71-
<Button
72-
variant="contained"
73-
href=""
74-
className="applyButton"
75-
disabled={apply}
76-
onClick={applyHandler}
77-
>
78-
{apply ? (
79-
<Typography>Applying...</Typography>
80-
) : (
81-
<Typography>Apply</Typography>
82-
)}
83-
</Button>
89+
{!props.disabled ? (
90+
<Button
91+
variant="contained"
92+
href=""
93+
className="applyButton"
94+
disabled={apply}
95+
onClick={applyHandler}
96+
>
97+
{apply ? (
98+
<Typography>Applying...</Typography>
99+
) : (
100+
<Typography>Apply</Typography>
101+
)}
102+
</Button>
103+
) : (
104+
<Label color={getStatusColor(props.status)}>{props.status}</Label>
105+
)}
84106
</div>
85107
);
86108
}

frontend/src/pages/ApplicantHome.jsx

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,33 @@ function ApplicantHome() {
2323
<Typography>Update my Profile</Typography>
2424
</Button>
2525

26-
<Container className="row" sx={{ marginTop: "20px" }}>
27-
<Typography align="center" variant="h5">
28-
Job List
29-
</Typography>
30-
31-
<IconButton className="toggleJobs" onClick={toggleJobs}>
32-
<ArrowDropDownIcon
33-
fontSize="large"
34-
className={showJobs ? "rotate" : ""}
35-
/>
36-
</IconButton>
37-
38-
<Typography align="left" variant="h5">
39-
Applied Jobs
40-
</Typography>
41-
<IconButton className="toggleJobs" onClick={toggleAppliedJobs}>
42-
<ArrowDropDownIcon
43-
fontSize="large"
44-
className={showJobs ? "rotate" : ""}
45-
/>
46-
</IconButton>
47-
</Container>
48-
49-
{showJobs && <JobList />}
50-
{appliedList && <JobApply />}
26+
<Box className="column" sx={{ marginTop: "20px" }}>
27+
<div className="row">
28+
<Typography align="center" variant="h5">
29+
Jobs For You
30+
</Typography>
31+
<IconButton className="toggleJobs" onClick={toggleJobs}>
32+
<ArrowDropDownIcon
33+
fontSize="large"
34+
className={showJobs ? "rotate" : ""}
35+
/>
36+
</IconButton>
37+
</div>
38+
{showJobs && <JobList />}
39+
40+
<div className="row">
41+
<Typography align="left" variant="h5">
42+
Pending Jobs
43+
</Typography>
44+
<IconButton className="toggleJobs" onClick={toggleAppliedJobs}>
45+
<ArrowDropDownIcon
46+
fontSize="large"
47+
className={appliedList ? "rotate" : ""}
48+
/>
49+
</IconButton>
50+
</div>
51+
{appliedList && <JobApply />}
52+
</Box>
5153
</Box>
5254
);
5355
}

0 commit comments

Comments
 (0)