Skip to content
Open
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
72 changes: 72 additions & 0 deletions src/lib-components/sidebar/Navigation.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.navbar {
background-color: #060b26;
height: 80px;
display: flex;
justify-content: flex-start;
align-items: center;
}

.menu-bars {
margin-left: 2rem;
font-size: 2rem;
background: none;
}

.nav-menu {
background-color: #060b26;
width: 250px;
height: 100vh;
display: flex;
justify-content: center;
position: fixed;
top: 0;
left: -100%;
transition: 850ms;
}

.nav-menu.active {
left: 0;
transition: 350ms;
}

.nav-text {
display: flex;
justify-content: flex-start;
align-items: center;
padding: 8px 0px 8px 16px;
list-style: none;
height: 60px;
}

.nav-text a {
text-decoration: none;
color: #f5f5f5;
font-size: 18px;
width: 95%;
height: 100%;
display: flex;
align-items: center;
padding: 0 16px;
border-radius: 4px;
}

.nav-text a:hover {
background-color: #1a83ff;
}

.nav-menu-items {
width: 100%;
}

.navbar-toggle {
background-color: #060b26;
width: 100%;
height: 80px;
display: flex;
justify-content: flex-start;
align-items: center;
}

span {
margin-left: 16px;
}
46 changes: 46 additions & 0 deletions src/lib-components/sidebar/Navigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React, { useState } from 'react';
import * as FaIcons from 'react-icons/fa';
import * as AiIcons from 'react-icons/ai';
import { Link } from 'react-router-dom';
import { Sidebar} from './Sidebar';
import './Navigation.css';
import { IconContext } from 'react-icons';

function Navbar() {
const [sidebar, setSidebar] = useState(false);

const showSidebar = () => setSidebar(!sidebar);

return (
<>
<IconContext.Provider value={{ color: '#fff' }}>
<div className='navbar'>
<Link to='#' className='menu-bars'>
<FaIcons.FaBars onClick={showSidebar} />
</Link>
</div>
<nav className={sidebar ? 'nav-menu active' : 'nav-menu'}>
<ul className='nav-menu-items' onClick={showSidebar}>
<li className='navbar-toggle'>
<Link to='#' className='menu-bars'>
<AiIcons.AiOutlineClose />
</Link>
</li>
{Sidebar.map((item, index) => {
return (
<li key={index} className={item.cName}>
<Link to={item.path}>
{item.icon}
<span>{item.title}</span>
</Link>
</li>
);
})}
</ul>
</nav>
</IconContext.Provider>
</>
);
}

export default Navbar;
43 changes: 43 additions & 0 deletions src/lib-components/sidebar/Sidebar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react';
import * as FaIcons from 'react-icons/fa';
import * as AiIcons from 'react-icons/ai';
import * as IoIcons from 'react-icons/io';

export const Sidebar = [
{
title: 'Home',
path: '/',
icon: <AiIcons.AiFillHome />,
cName: 'nav-text'
},
{
title: 'Reports',
path: '/reports',
icon: <IoIcons.IoIosPaper />,
cName: 'nav-text'
},
{
title: 'Products',
path: '/products',
icon: <FaIcons.FaCartPlus />,
cName: 'nav-text'
},
{
title: 'Team',
path: '/team',
icon: <IoIcons.IoMdPeople />,
cName: 'nav-text'
},
{
title: 'Messages',
path: '/messages',
icon: <FaIcons.FaEnvelopeOpenText />,
cName: 'nav-text'
},
{
title: 'Login',
path: '/login',
icon: <IoIcons.IoMdHelpCircle />,
cName: 'nav-text'
}
];