Skip to content

Commit

Permalink
feat: add component navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Apr 6, 2022
1 parent b6bb28e commit b28d942
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/components/Navbar/Navbar.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.navbar {
height: var(--nav-size);
background-color: var(--black-medium);
padding: 0 1rem;
border-bottom: 1px solid #474a4d;
display: flex;
justify-content: space-between;
align-items: center;
}

.navbarNav {
max-width: 100%;
height: 100%;
display: flex;
justify-content: flex-end;
}

.icon {
cursor: pointer;
}

.logo {
width: 90px;
}
28 changes: 28 additions & 0 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { IoArrowBackOutline } from 'react-icons/io5';
import { useNavigate } from 'react-router-dom';

import logo from 'assets/Logo.png';
import { NavBarProps } from 'types/IComponents';

import styles from './Navbar.module.scss';

export function Navbar(props: NavBarProps) {
const navigate = useNavigate();
return (
<>
<nav className={styles.navbar}>
{props.back && (
<IoArrowBackOutline
size={24}
className={styles.icon}
onClick={() => {
navigate('/');
}}
/>
)}
{props.logo && <img src={logo} alt="Logo" className={styles.logo} />}
<ul className={styles.navbarNav}>{props.children}</ul>
</nav>
</>
);
}

0 comments on commit b28d942

Please sign in to comment.