Skip to content

Commit

Permalink
Applications recruited added
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushabh2805 committed Oct 12, 2024
1 parent cd4a439 commit 1412e2d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
1 change: 1 addition & 0 deletions components/Utils/IconMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const iconMap: { [key: string]: React.ReactElement } = {
"Aptitude Test": <AssignmentIcon fontSize="large" />,
"Technical Interview": <PeopleIcon fontSize="large" />,
"HR Interview": <HandshakeIcon fontSize="large" />,
Recruited: <AttachFileIcon fontSize="large" />,
Other: <AttachFileIcon fontSize="large" />,
};

Expand Down
29 changes: 25 additions & 4 deletions pages/company/rc/[rcid]/proforma/[proformaid]/step5.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable eqeqeq */
import AddIcon from "@mui/icons-material/Add";
import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
import AttachFileIcon from "@mui/icons-material/AttachFile";
Expand Down Expand Up @@ -33,6 +34,7 @@ import Meta from "@components/Meta";
import eventRequest from "@callbacks/company/rc/proforma/event";
import useStore from "@store/store";
import { successNotification } from "@callbacks/notifcation";
import { Key } from "react";

const ROUTE = "/company/rc/[rcid]/proforma/[proformaid]/step6";

Expand Down Expand Up @@ -67,6 +69,7 @@ function Step5() {
control,
name: "fieldArray",
});

useEffect(() => {
const fetchStep4 = async () => {
if (router.isReady) {
Expand Down Expand Up @@ -96,11 +99,11 @@ function Step5() {
}, [token, proformaid, rcid, router.isReady, reset]);
const [activeStep, setActiveStep] = useState(0);
const handleNext = () => {
setActiveStep((prevActiveStep) => prevActiveStep + 1);
setActiveStep((prevActiveStep: number) => prevActiveStep + 1);
};

const handleBack = () => {
setActiveStep((prevActiveStep) => prevActiveStep - 1);
setActiveStep((prevActiveStep: number) => prevActiveStep - 1);
};

const handleReset = () => {
Expand Down Expand Up @@ -161,6 +164,13 @@ function Step5() {
};

const handleAdd = (id: number) => {
if (fields.length == 0) {
append({
label: "Applications",
duration: "0 min",
});
setActiveStep(fields.length + 1);
}
append({
label: tiles[id].label,
duration: tiles[id].duration,
Expand Down Expand Up @@ -276,7 +286,7 @@ function Step5() {
</Box>
</StepContent>
</Step>
{fields.map((step, index) => (
{fields.map((step: { ID: Key | null | undefined; }, index: number) => (
<Step key={step.ID}>
<StepLabel>
<Card sx={{ padding: 2, width: "300px" }}>
Expand Down Expand Up @@ -327,7 +337,18 @@ function Step5() {
<div>
<Button
variant="contained"
onClick={handleNext}
onClick={() => {
if (index === fields.length - 1) {
append({
label: "Recuited",
duration: "0 min",
});
setActiveStep(fields.length + 1);
}
setActiveStep(
(prevActiveStep: number) => prevActiveStep + 1
);
}}
sx={{ mt: 1, mr: 1 }}
>
{index === fields.length - 1 ? "Finish" : "Continue"}
Expand Down

0 comments on commit 1412e2d

Please sign in to comment.