Skip to content

Commit

Permalink
Merge pull request #98 from CybercentreCanada/feature/auto_collapse
Browse files Browse the repository at this point in the history
Have section collapsed by default when auto-collapsed is true
  • Loading branch information
cccs-sgaron authored Aug 3, 2021
2 parents 21613d8 + cf82f64 commit 30c209a
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 30c209a

Please sign in to comment.