Skip to content

Commit

Permalink
Fix Proforma View(#7)
Browse files Browse the repository at this point in the history
Fix Proforma View
  • Loading branch information
utkarsh-tf141 authored Feb 13, 2024
2 parents 2027d1a + 828697f commit 58b79da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions components/Utils/MatrixExpanded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TableCell,
TableContainer,
TableRow,
Typography,
// Typography,
} from "@mui/material";
import React from "react";
import CloseIcon from "@mui/icons-material/Close";
Expand All @@ -15,8 +15,8 @@ import CheckIcon from "@mui/icons-material/Check";
import { Branches, func } from "@components/Utils/matrixUtils";

function MatrixExpanded({ data }: { data: string }) {
if (data?.length < 110)
return <Typography>Eligibility Matrix Not Found</Typography>;
// if (data?.length < 110)
// return <Typography>Eligibility Matrix Not Found</Typography>;
return (
<TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} aria-label="simple table">
Expand Down
6 changes: 3 additions & 3 deletions pages/admin/rc/[rcid]/proforma/[proformaid]/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const textFieldSX = {
fontWeight: "bold",
},
};
const data1 = new Array(100 + 1).join("0");

function View() {
const { token } = useStore();
Expand All @@ -37,6 +36,7 @@ function View() {
ID: 0,
} as AdminProformaType);
const [row2, setRow2] = useState<Event[]>([]);
const [elig, setElig] = useState("");
useEffect(() => {
const getCompanydata = async () => {
if (router.isReady) {
Expand All @@ -48,11 +48,11 @@ function View() {
setJd(response.job_description);
setPd(response.package_details);
setisFetched(true);
setElig(response.eligibility);
}
};
getCompanydata();
}, [token, rid, ID, router.isReady]);
const data = row.eligibility?.length > 110 ? row.eligibility : data1;
return (
<div style={{ padding: "0 2rem", marginBottom: 20 }}>
<Meta title={`${PID} - Proforma Details`} />
Expand Down Expand Up @@ -158,7 +158,7 @@ function View() {
</Grid>
<Grid item xs={12}>
<h3>Eligibility</h3>
<MatrixExpanded data={data} />
<MatrixExpanded data={elig} />
</Grid>
<Grid item xs={12}>
<h3>Hiring Process</h3>
Expand Down
8 changes: 5 additions & 3 deletions pages/company/rc/[rcid]/proforma/[proformaid]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const textFieldSX = {
fontWeight: "bold",
},
};
const data1 = new Array(100 + 1).join("0");
// const data1 = new Array(100 + 1).join("0");

function Index() {
const { token } = useStore();
Expand All @@ -29,6 +29,7 @@ function Index() {
const [jd, setJd] = useState("");
const [pd, setPd] = useState("");
const [isFetched, setisFetched] = useState(false);
const [elig, setElig] = useState("");
const [row, setRow] = useState<ProformaType>({
ID: 0,
} as ProformaType);
Expand All @@ -45,10 +46,11 @@ function Index() {
setJd(response.job_description);
setPd(response.package_details);
setisFetched(true);
setElig(response.eligibility);
};
getCompanydata();
}, [token, rid, ID]);
const data = row.eligibility?.length > 110 ? row.eligibility : data1;
// const data = row.eligibility?.length > 110 ? row.eligibility : data1;
return (
<div style={{ padding: "0 2rem", marginBottom: 20 }}>
<Meta title="Proforma" />
Expand Down Expand Up @@ -128,7 +130,7 @@ function Index() {
</Grid>
<Grid item xs={12}>
<h3>Eligibility</h3>
<MatrixExpanded data={data} />
<MatrixExpanded data={elig} />
</Grid>
{/* <Grid item xs={12}>
<h3>Hiring Process</h3>
Expand Down

0 comments on commit 58b79da

Please sign in to comment.