Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit 036ebb5

Browse files
author
dpatanin
committed
add icons
1 parent a781aae commit 036ebb5

4 files changed

Lines changed: 54 additions & 23 deletions

File tree

package-lock.json

Lines changed: 14 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"react-burger-menu": "^2.7.0",
3030
"react-dom": "^16.13.1",
3131
"react-helmet": "^6.1.0",
32+
"react-icons": "^3.11.0",
3233
"react-tabs": "^3.1.1"
3334
},
3435
"devDependencies": {

src/components/Sidebar.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { Fragment, useState } from 'react';
22
import { Link } from 'gatsby';
3+
import { IoIosArrowDown, IoIosArrowForward } from 'react-icons/io';
34

45
/**
56
* Interactive Sidebar with toggleable categories.
@@ -10,9 +11,7 @@ const Sidebar = ({ categories = [], currentPathname }) => {
1011
const [selectedCategory, selectCategory] = useState(() => {
1112
for (const { categoryName, entries } of categories) {
1213
for (const entry of entries) {
13-
if (
14-
currentPathname === `/integrations/${entry.node.frontmatter.path}`
15-
) {
14+
if (currentPathname.includes(entry.node.frontmatter.path)) {
1615
return categoryName;
1716
}
1817
}
@@ -33,9 +32,21 @@ const Sidebar = ({ categories = [], currentPathname }) => {
3332
selectedCategory === categoryName ? null : categoryName
3433
)
3534
}
36-
className="sidebar-header"
35+
className="sidebar-category"
3736
>
3837
{categoryName}
38+
<IoIosArrowDown
39+
className="arrow"
40+
style={{
41+
display: selectedCategory === categoryName ? 'block' : 'none',
42+
}}
43+
/>
44+
<IoIosArrowForward
45+
className="arrow"
46+
style={{
47+
display: selectedCategory === categoryName ? 'none' : 'block',
48+
}}
49+
/>
3950
</button>
4051
<ul
4152
id={categoryName}
@@ -46,7 +57,10 @@ const Sidebar = ({ categories = [], currentPathname }) => {
4657
}}
4758
>
4859
{entries.map((element) => (
49-
<li key={element.node.frontmatter.title}>
60+
<li
61+
key={element.node.frontmatter.title}
62+
className="sidebar-element"
63+
>
5064
<Link
5165
to={`/integrations/${element.node.frontmatter.path}`}
5266
activeClassName="active-Link"

src/scss/components/_sidebar.scss

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ a {
5252
min-width: 10px;
5353
max-width: 10px;
5454
text-align: center;
55-
.sidebar-header {
55+
.sidebar-category {
5656
h3 {
5757
display: none;
5858
}
@@ -81,23 +81,23 @@ a {
8181
}
8282
}
8383
}
84-
.sidebar-header {
84+
.sidebar-category {
8585
margin-bottom: 0px;
8686
padding: 20px;
87-
width: auto;
87+
width: 100%;
8888
font-size: 1.3rem;
89-
// disable text selection on sidebar
90-
-webkit-touch-callout: none; /* iOS Safari */
91-
-webkit-user-select: none; /* Safari */
92-
-khtml-user-select: none; /* Konqueror HTML */
93-
-moz-user-select: none; /* Old versions of Firefox */
94-
-ms-user-select: none; /* Internet Explorer/Edge */
95-
user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
89+
text-align: left;
9690
}
97-
.sidebar-header:hover {
91+
.sidebar-category:hover {
9892
cursor: pointer;
9993
box-shadow: 0 1px 18px rgba(0, 0, 0, 0.2);
10094
}
95+
.sidebar-element {
96+
font-size: 1rem;
97+
a {
98+
text-indent: 30px;
99+
}
100+
}
101101
}
102102
#content {
103103
width: auto;
@@ -107,12 +107,20 @@ a {
107107
transition: all 0.3s;
108108
}
109109

110-
// removing button style
111110
button {
111+
display: flex;
112+
justify-content: space-between;
113+
align-items: center;
114+
115+
// Remove default button style
112116
background: none;
113117
color: inherit;
114118
border: none;
115119
padding: 0;
116120
cursor: pointer;
117121
outline: inherit;
118122
}
123+
124+
*:focus {
125+
outline: 0 !important;
126+
}

0 commit comments

Comments
 (0)