Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rushabh0 #350

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
31 changes: 26 additions & 5 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 Expand Up @@ -406,7 +427,7 @@ function Step5() {
const { fieldArray } = data;
let push = 1;
let count = 0;
// eslint-disable-next-line no-loop-func
// eslint-disable-next-line no-loop-fun
for (let i = 0; i < fieldArray.length; i += 1) {
fieldArray[i].proforma_id = parseInt(
(proformaid || "").toString(),
Expand Down
Loading