Skip to content

Commit

Permalink
1240: skipping hidden sidebar items (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvshmakov authored Jul 1, 2020
1 parent 655f696 commit f7291d1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
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

0 comments on commit f7291d1

Please sign in to comment.