Skip to content

Commit

Permalink
Merge pull request #181 from Aar-if/main
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
itsvick authored Aug 30, 2024
2 parents eb7647f + 8a04370 commit 20e1f1a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 84 deletions.
55 changes: 1 addition & 54 deletions src/components/FilterSearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,60 +73,7 @@ const FilterSearchBar: React.FC<FilterSearchBarProps> = ({
</Typography>
</Box>
)}
{showGradeMedium && (
<Box
sx={{
p: 1,
display: "flex",
mb: 2,
gap: 2,
flexWrap: "wrap",
}}
>
<FormControl
variant="outlined"
size="small"
sx={{
minWidth: isSmallScreen ? "100px" : "120px",
}}
>
<InputLabel id="grade-label">
{t("COURSE_PLANNER.GRADE")}
</InputLabel>
<Select
labelId="grade-label"
value={grade}
onChange={handleGradeChange}
label="Grade"
>
<MenuItem value="grade1">Grade 1</MenuItem>
<MenuItem value="grade2">Grade 2</MenuItem>
<MenuItem value="grade3">Grade 3</MenuItem>
</Select>
</FormControl>
<FormControl
variant="outlined"
size="small"
sx={{
minWidth: isSmallScreen ? "100px" : "120px",
}}
>
<InputLabel id="medium-label">
{t("COURSE_PLANNER.MEDIUM")}
</InputLabel>
<Select
labelId="medium-label"
value={medium}
onChange={handleMediumChange}
label="Medium"
>
<MenuItem value="english">English</MenuItem>
<MenuItem value="hindi">Hindi</MenuItem>
<MenuItem value="marathi">Marathi</MenuItem>
</Select>
</FormControl>
</Box>
)}


{card && (
<Box
Expand Down
4 changes: 2 additions & 2 deletions src/data/cardData.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
let state;

if (typeof window !== 'undefined') {
state = localStorage.getItem('stateName');
state = 'Maharashtra'
}
const cardData = [
{
id: "1",
state: state,
boardsUploaded: 1,
boardsUploaded: 0,
totalBoards: 1,
details:
"Maharashtra is a state in the southeastern coastal region of India.",
Expand Down
24 changes: 12 additions & 12 deletions src/pages/importCsv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ const ImportCsv = () => {
try {
setLoading(true);
const response = await getTargetedSolutions({
subject: 'Assamese',
class: '6',
subject: 'Tamil',
class: '4',
state: 'Maharashtra',
board: 'AAKR',
board: 'TQKR',
type: 'mainCourse',
medium: 'Assamese',
medium: 'Telugu',
});

const courseData = response.result.data[0];
Expand Down Expand Up @@ -115,12 +115,12 @@ const ImportCsv = () => {
});

const updatedResponse = await getTargetedSolutions({
subject: 'Assamese',
class: '6',
subject: 'Tamil',
class: '4',
state: 'Maharashtra',
board: 'AAKR',
board: 'TQKR',
type: 'mainCourse',
medium: 'Assamese',
medium: 'Telugu',
});
setLoading(false);
return updatedResponse.result.data[0]._id;
Expand Down Expand Up @@ -175,12 +175,12 @@ const ImportCsv = () => {
const handleUpload = async () => {
if (selectedFile) {
const metaData: CoursePlannerMetaData = {
subject: 'Assamese',
class: '6',
subject: 'Tamil',
class: '4',
state: 'Maharashtra',
board: 'AAKR',
board: 'TQKR',
type: 'mainCourse',
medium: 'Assamese',
medium: 'Telugu',
};

const result = await uploadCoursePlanner(selectedFile, metaData)
Expand Down
20 changes: 4 additions & 16 deletions src/pages/subjectDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ const SubjectDetails = () => {
return <Loader showBackdrop={true} loadingText="Loading..." />;
}

if (!card) {
return <Typography>Card not found</Typography>;
}


const handleBackClick = () => {
router.back();
Expand Down Expand Up @@ -139,22 +137,12 @@ const SubjectDetails = () => {
<IconButton onClick={handleBackClick}>
<ArrowBackIcon />
</IconButton>
<Typography variant="h4">{card.state}</Typography>
<Typography variant="h4">{card?.state}</Typography>

<Box sx={{ width: "40px", height: "40px" }}>
<CircularProgressbar
value={(card.boardsUploaded / card.totalBoards) * 100}
strokeWidth={10}
styles={buildStyles({
pathColor: "#06A816",
trailColor: "#E6E6E6",
strokeLinecap: "round",
})}
/>

</Box>
<Typography sx={{ fontSize: "14px" }}>
{card.boardsUploaded} / {card.totalBoards} {"boards fully uploaded"}
</Typography>

</Box>
<Box sx={{ marginTop: "16px" }}>
{subject?.terms?.map((subj:any, index:any) => (
Expand Down

0 comments on commit 20e1f1a

Please sign in to comment.