Skip to content

Commit

Permalink
minor. set open to true by default if offline
Browse files Browse the repository at this point in the history
  • Loading branch information
seungpark committed Dec 19, 2024
1 parent 42ae57a commit 80a2a7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Collapsible/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Collapsible = ({ nodeData: { children, options }, sectionDepth, ...rest })
return findAllNestedAttribute(children, 'id');
}, [children]);

const [open, setOpen] = useState(() => expanded ?? true);
const [open, setOpen] = useState(() => (expanded || isOfflineDocsBuild) ?? true);
const headingNodeData = {
id,
children: [{ type: 'text', value: heading }],
Expand Down Expand Up @@ -84,7 +84,7 @@ const Collapsible = ({ nodeData: { children, options }, sectionDepth, ...rest })
aria-expanded={open}
onClick={onIconClick}
>
<Icon glyph={open || isOfflineDocsBuild ? 'ChevronDown' : 'ChevronRight'} />
<Icon glyph={open ? 'ChevronDown' : 'ChevronRight'} />
</IconButton>
</Box>
<Box className={cx(innerContentStyle, isOfflineDocsBuild ? CONTENT_CLASSNAME : '')}>
Expand Down

0 comments on commit 80a2a7b

Please sign in to comment.