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

Added checkbox and corrected branch names (PHY and CHM) #309

Closed
wants to merge 3 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
16 changes: 8 additions & 8 deletions components/Utils/matrixUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export const BranchesExpanded = [
"EE",
"MSE",
"ME",
"CH",
"CHM",
"ECO",
"ES",
"MTH",
"SDS",
"Ph",
"PHY",
"CGS",
"DES",
"MS",
Expand All @@ -59,12 +59,12 @@ export const Branches = [
"Electrical Engineering (EE)",
"Material Science and Engineering (MSE)",
"Mechanical Engineering (ME)",
"Chemistry (CH)",
"Chemistry (CHM)",
"Economics (ECO)",
"Earth Sciences (ES)",
"Mathematics and Scientific Computing (MTH)",
"Statistics and Data Science (SDS)",
"Physics (Ph)",
"Physics (PHY)",
"Cognitive Science (CGS)",
"Design (DES)",
"Management Studies (MS)",
Expand Down Expand Up @@ -206,7 +206,7 @@ export const func = {
MSc: -1,
MSR: 90,
},
"Chemistry (CH)": {
"Chemistry (CHM)": {
BT: -1,
BS: 9,
MT: -1,
Expand Down Expand Up @@ -276,7 +276,7 @@ export const func = {
MSc: -1,
MSR: -1,
},
"Physics (Ph)": {
"Physics (PHY)": {
BT: -1,
BS: 13,
MT: -1,
Expand Down Expand Up @@ -559,7 +559,7 @@ export const funcExpanded = {
MSc: -1,
MSR: 90,
},
CH: {
CHM: {
BT: -1,
BS: 9,
MT: -1,
Expand Down Expand Up @@ -629,7 +629,7 @@ export const funcExpanded = {
MSc: -1,
MSR: -1,
},
Ph: {
PHY: {
BT: -1,
BS: 13,
MT: -1,
Expand Down
41 changes: 40 additions & 1 deletion pages/company/rc/[rcid]/proforma/[proformaid]/step6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import {
Autocomplete,
Button,
Card,
Checkbox,
FormControl,
FormControlLabel,
Link,
Stack,
TextField,
Typography,
} from "@mui/material";
import React, { useEffect, useState } from "react";
import { useRouter } from "next/router";
Expand Down Expand Up @@ -35,6 +39,8 @@ function Step5() {
} = useForm<ProformaType>({
defaultValues: fetchData,
});
const [isCheckboxChecked, setIsCheckboxChecked] = useState(false);

const handleNext = async (data: ProformaType) => {
const info = {
...data,
Expand All @@ -53,6 +59,11 @@ function Step5() {
});
}
};

const handleCheckboxChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setIsCheckboxChecked(event.target.checked);
};

useEffect(() => {
if (!(rid && pid)) return;
const getStep5 = async () => {
Expand Down Expand Up @@ -144,6 +155,33 @@ function Step5() {
/>
</FormControl>

<FormControl sx={{ m: 1 }}>
<FormControlLabel
control={
<Checkbox
checked={isCheckboxChecked}
onChange={handleCheckboxChange}
inputProps={{
"aria-label": "Checkbox to enable submit button",
}}
/>
}
label={
<Typography>
Accept the terms given in{" "}
<Link
href="https://spo.iitk.ac.in/assets/companies_links/Annexure-1-Revised.docx"
target="_blank"
rel="noopener noreferrer"
>
AIPC Guidelines
</Link>
.
</Typography>
}
/>
</FormControl>

<Stack
spacing={3}
direction="row"
Expand All @@ -153,7 +191,7 @@ function Step5() {
<Button
variant="contained"
sx={{ width: "50%" }}
disabled={!router.isReady || rid === ""}
disabled={!isCheckboxChecked || !router.isReady || rid === ""}
onClick={handleSubmit(handleNext)}
>
Submit
Expand All @@ -167,6 +205,7 @@ function Step5() {
message_for_cordinator: "",
active_hr: "",
});
setIsCheckboxChecked(false);
}}
>
Reset
Expand Down
Loading