Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: skipping hidden sidebar items #1519

Merged
merged 1 commit into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/Community/Section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ const Section: React.FC<ICommunitySection> = ({
{background && <img className={styles.picture} src={background} alt="" />}

{isTablet ? (
<Collapse isOpened={isContentVisible}>{children}</Collapse>
<span hidden={!isContentVisible}>
<Collapse isOpened={isContentVisible}>{children}</Collapse>
</span>
) : (
children
)}
Expand Down
22 changes: 12 additions & 10 deletions src/components/Documentation/Layout/SidebarMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,18 @@ const SidebarMenuItem: React.FC<ISidebarMenuItemProps> = ({
<>
{parentElement}
{children && (
<Collapse isOpened={!!isActive}>
{children.map(item => (
<SidebarMenuItem
key={item.path}
activePaths={activePaths}
onClick={onClick}
{...item}
/>
))}
</Collapse>
<span hidden={!isActive}>
<Collapse isOpened={!!isActive}>
{children.map(item => (
<SidebarMenuItem
key={item.path}
activePaths={activePaths}
onClick={onClick}
{...item}
/>
))}
</Collapse>
</span>
)}
</>
)
Expand Down
4 changes: 3 additions & 1 deletion src/components/Home/UseCases/CollapsibleText/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const CollapsibleText: React.FC<ICollapsibleTextProps> = ({
tabIndex={0}
>
{header}
<Collapse isOpened={isOpened}>{children}</Collapse>
<span hidden={!isOpened}>
<Collapse isOpened={isOpened}>{children}</Collapse>
</span>
{!isOpened && <div className={styles.moreText}>More...</div>}
</div>
)
Expand Down