Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

Commit 534588c

Browse files
authored
course card collapsing fixed (#121)
1 parent f07febd commit 534588c

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/views/pages/Courses/Schedule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function BatchDropBox({ course, batch, batchIndex, expanded, setExpanded }) {
194194
{batchIndex === expanded ? (
195195
<IconButton
196196
onClick={() => {
197-
setExpanded(-1);
197+
batchIndex = !batchIndex;
198198
}}
199199
>
200200
<ExpandLessIcon />

src/views/pages/Courses/partials/FAQuestions.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,19 @@ function QuestionDropBox({ question, questionIndex, expanded, setExpanded }) {
6262
>
6363
<Box fontWeight={500}>{question.title}</Box>
6464
</Typography>
65-
66-
<IconButton>
67-
{expanded === questionIndex ? <ExpandLessIcon /> : <ExpandMoreIcon />}
68-
</IconButton>
65+
{questionIndex === expanded ? (
66+
<IconButton
67+
onClick={() => {
68+
questionIndex = !questionIndex;
69+
}}
70+
>
71+
<ExpandLessIcon />
72+
</IconButton>
73+
) : (
74+
<IconButton>
75+
<ExpandMoreIcon />
76+
</IconButton>
77+
)}
6978
</Box>
7079

7180
<Collapse in={expanded === questionIndex}>

src/views/pages/common/Apply.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const useStyles = makeStyles(theme => ({
6262

6363
function Apply({ className, ...rest }) {
6464
const classes = useStyles();
65-
65+
6666
return (
6767
<div
6868
className={clsx(classes.root, className)}

0 commit comments

Comments
 (0)