Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion src/components/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function Sidebar({ className = "", pages, currentPage }) {

{pages.map((page, index) => {
const displayGroup = group !== page.group && page.group !== "-";
// eslint-disable-next-line react-hooks/immutability
// eslint-disable-next-line react-hooks/immutability
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok , I Fixed it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I fixed it

group = page.group;

return (
Expand Down
28 changes: 15 additions & 13 deletions src/components/SidebarItem/SidebarItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import PropTypes from "prop-types";
import { Component } from "react";
import "./SidebarItem.scss";
import { NavLink } from "react-router-dom";
import ChevronRightIcon from "../../styles/icons/chevron-right.svg";
import GraphIcon from "../../styles/icons/graph.svg";
import BarIcon from "../../styles/icons/vertical-bar.svg";
import list2Tree from "../../utilities/list2Tree/index.js";

Expand Down Expand Up @@ -57,26 +57,28 @@ export default class SidebarItem extends Component {
const { title, anchors = [] } = this.props;
const openMod = this.state.open ? `${block}--open` : "";
const disabledMod = anchors.length === 0 ? `${block}--disabled` : "";
const isDependencyGraph = title === "Dependency Graph";

const filteredAnchors = anchors.filter((anchor) => anchor.level > 1);
const tree = list2Tree(title, filteredAnchors);

return (
<div className={`${block} ${openMod} ${disabledMod}`}>
{anchors.length > 0 ? (
<button
className={`${block}__toggle-button`}
<GraphIcon
width={15}
height={17}
fill="#175d96"
Comment on lines 67 to 71
className={`${block}__toggle ${block}__toggle--graph`}
onClick={this._toggle.bind(this)}
aria-label={`Toggle ${title} section`}
aria-expanded={this.state.open}
>
<ChevronRightIcon
width={15}
height={17}
fill="#175d96"
className={`${block}__toggle`}
/>
</button>
/>
) : isDependencyGraph ? (
<GraphIcon
className={`${block}__toggle ${block}__toggle--static`}
width={15}
height={17}
fill="#175d96"
/>
) : (
<BarIcon
className={`${block}__toggle`}
Expand Down
10 changes: 9 additions & 1 deletion src/components/SidebarItem/SidebarItem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
&:hover {
color: getColor(mine-shaft);
}

&--static {
cursor: default;

&:hover {
color: getColor(denim);
}
}
}

&__toggle-button {
Expand Down Expand Up @@ -97,7 +105,7 @@
display: flex;
}

.sidebar-item__toggle {
.sidebar-item__toggle--graph {
transform-origin: center center;
transform: rotate(90deg);
}
Expand Down
10 changes: 10 additions & 0 deletions src/styles/icons/graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading