Skip to content

Commit

Permalink
Merge pull request #99 from CybercentreCanada/feature/auto_collapse
Browse files Browse the repository at this point in the history
Feature/auto collapse
  • Loading branch information
cccs-sgaron authored Aug 3, 2021
2 parents f60aa6d + cf82f64 commit 390ad59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/visual/ResultCard/result_section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ export type SectionItem = {
};

export type Section = {
auto_collapse: boolean;
body: any;
body_format: string;
classification: string;
Expand Down Expand Up @@ -474,7 +475,7 @@ const ResultSection: React.FC<ResultSectionProps> = ({
const classes = useStyles();
const theme = useTheme();
const section = section_list[id];
const [open, setOpen] = React.useState(true);
const [open, setOpen] = React.useState(!section.auto_collapse);
const { getKey, hasHighlightedKeys } = useHighlighter();
const { c12nDef } = useALContext();

Expand Down

0 comments on commit 390ad59

Please sign in to comment.