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

Update sidenav for Role & Skills Intake in Taas-App #21

Merged
merged 3 commits into from
May 26, 2021
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
19 changes: 10 additions & 9 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
/* global process */
const express = require("express");
const express = require('express');

const app = express();

app.use('/navbar',
express.static("./dist", {
app.use(
'/navbar',
express.static('./dist', {
setHeaders: function setHeaders(res) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET");
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET');
res.header(
"Access-Control-Allow-Headers",
"Origin, X-Requested-With, Content-Type, Accept"
'Access-Control-Allow-Headers',
'Origin, X-Requested-With, Content-Type, Accept'
);
},
})
);

app.get('/', function (req, res) {
res.send('alive')
})
res.send('alive');
});

const PORT = process.env.PORT || 3001;
app.listen(PORT, '0.0.0.0');
Expand Down
15 changes: 15 additions & 0 deletions src/assets/images/create-team-green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/assets/images/create-team.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 21 additions & 12 deletions src/components/Menu/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
*
* General component to show menu with submenu.
*/
import React, { Fragment, useCallback, useState } from "react";
import { useLocation } from "@reach/router";
import cn from "classnames";
import { includes, map } from "lodash";
import NavLink from "../NavLink";
import "./styles.css";
import React, { Fragment, useCallback, useState } from 'react';
import { useLocation } from '@reach/router';
import cn from 'classnames';
import { includes, map } from 'lodash';
import NavLink from '../NavLink';
import './styles.css';

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

const [isOpen, setIsOpen] = useState(
includes(map(option.children, "path"), location.pathname)
includes(map(option.children, 'path'), location.pathname)
);

const toggleOpen = useCallback(() => {
Expand All @@ -24,8 +24,8 @@ const SubMenu = ({ option }) => {
return (
<>
<span
className={cn("menu-link menu-link-toggle", {
"menu-link-toggle-up": isOpen,
className={cn('menu-link menu-link-toggle', {
'menu-link-toggle-up': isOpen,
})}
onClick={toggleOpen}
role="button"
Expand Down Expand Up @@ -62,10 +62,19 @@ const Menu = ({ options, sidebarCollapsed }) => (
to={option.path}
activeClassName="menu-link-active"
className="menu-link"
exact={option.isExact}
>
<img src={option.activeIcon} className="subroute-icon active-icon" alt="Subroute Icon"/>
<img src={option.icon} className="subroute-icon gray-icon" alt="Subroute Icon"/>
{!sidebarCollapsed ? option.title : ''}
<img
src={option.activeIcon}
className="subroute-icon active-icon"
alt="Subroute Icon"
/>
<img
src={option.icon}
className="subroute-icon gray-icon"
alt="Subroute Icon"
/>
{!sidebarCollapsed ? option.title : ''}
</NavLink>
</Fragment>
) : (
Expand Down
Loading