Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit cb929e3

Browse files
committed
added item to nav
1 parent ea1c3cb commit cb929e3

File tree

5 files changed

+176
-128
lines changed

5 files changed

+176
-128
lines changed

server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ app.get('/', function (req, res) {
2020
res.send('alive')
2121
})
2222

23-
const PORT = process.env.PORT || 3001;
23+
const PORT = process.env.PORT || 3002;
2424
app.listen(PORT, '0.0.0.0');
2525
console.log(`App is hosted on port ${PORT}.`); // eslint-disable-line no-console
+15
Loading

src/assets/images/create-team.svg

+15
Loading

src/components/Menu/index.jsx

+22-12
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
*
44
* General component to show menu with submenu.
55
*/
6-
import React, { Fragment, useCallback, useState } from "react";
7-
import { useLocation } from "@reach/router";
8-
import cn from "classnames";
9-
import { includes, map } from "lodash";
10-
import NavLink from "../NavLink";
11-
import "./styles.css";
6+
import React, { Fragment, useCallback, useState } from 'react';
7+
import { useLocation } from '@reach/router';
8+
import cn from 'classnames';
9+
import { includes, map } from 'lodash';
10+
import NavLink from '../NavLink';
11+
import './styles.css';
1212

1313
const SubMenu = ({ option }) => {
1414
const location = useLocation();
1515

1616
const [isOpen, setIsOpen] = useState(
17-
includes(map(option.children, "path"), location.pathname)
17+
includes(map(option.children, 'path'), location.pathname)
1818
);
1919

2020
const toggleOpen = useCallback(() => {
@@ -24,8 +24,8 @@ const SubMenu = ({ option }) => {
2424
return (
2525
<>
2626
<span
27-
className={cn("menu-link menu-link-toggle", {
28-
"menu-link-toggle-up": isOpen,
27+
className={cn('menu-link menu-link-toggle', {
28+
'menu-link-toggle-up': isOpen,
2929
})}
3030
onClick={toggleOpen}
3131
role="button"
@@ -41,6 +41,7 @@ const SubMenu = ({ option }) => {
4141
to={subOption.path}
4242
activeClassName="menu-link-active"
4343
className="menu-link"
44+
exact
4445
>
4546
{subOption.title}
4647
</NavLink>
@@ -62,10 +63,19 @@ const Menu = ({ options, sidebarCollapsed }) => (
6263
to={option.path}
6364
activeClassName="menu-link-active"
6465
className="menu-link"
66+
exact
6567
>
66-
<img src={option.activeIcon} className="subroute-icon active-icon" alt="Subroute Icon"/>
67-
<img src={option.icon} className="subroute-icon gray-icon" alt="Subroute Icon"/>
68-
{!sidebarCollapsed ? option.title : ''}
68+
<img
69+
src={option.activeIcon}
70+
className="subroute-icon active-icon"
71+
alt="Subroute Icon"
72+
/>
73+
<img
74+
src={option.icon}
75+
className="subroute-icon gray-icon"
76+
alt="Subroute Icon"
77+
/>
78+
{!sidebarCollapsed ? option.title : ''}
6979
</NavLink>
7080
</Fragment>
7181
) : (

0 commit comments

Comments
 (0)