tasko-frontend/pages/components/Header.js

65 lines
2.4 KiB
JavaScript
Raw Permalink Normal View History

2020-01-13 16:20:19 +01:00
import Link from 'next/link';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCog, faTasks, faComments, faCommentDots, faUserPlus, faUser } from '@fortawesome/free-solid-svg-icons';
2020-01-13 16:20:19 +01:00
2020-01-20 13:11:45 +01:00
const Header = props => {
const isLogged = props.isLogged === "logged";
2020-01-13 16:20:19 +01:00
return (
<header>
<nav>
<ul>
<div className="navbar-options">
<li>
<Link href="/">
<a><img src="/taskoala.png" /></a>
2020-01-13 16:20:19 +01:00
</Link>
</li>
<li>
2020-01-20 11:51:46 +01:00
<Link href="/tasks">
<a><FontAwesomeIcon icon={faTasks} /> Zadania</a>
2020-01-13 16:20:19 +01:00
</Link>
</li>
<li>
<Link href="/">
<a><FontAwesomeIcon icon={faCommentDots} /> Pytania</a>
2020-01-13 16:20:19 +01:00
</Link>
</li>
<li>
<Link href="/">
<a><FontAwesomeIcon icon={faComments} /> Rozmowy</a>
2020-01-13 16:20:19 +01:00
</Link>
</li>
<li>
<Link href="/">
<a><FontAwesomeIcon icon={faCog} /> Ustawienia</a>
2020-01-13 16:20:19 +01:00
</Link>
</li>
</div>
<div className="navbar-auth">
2020-01-20 13:11:45 +01:00
{isLogged ?
<li>
<Link href="/profile">
<a>User name</a>
</Link>
</li>:
2020-01-13 16:20:19 +01:00
<li>
<Link href="/login">
<a><FontAwesomeIcon icon={faUser} /> Zaloguj się</a>
2020-01-13 16:20:19 +01:00
</Link>
</li>
2020-01-20 13:11:45 +01:00
}
<li className={isLogged ? "hidden" : ""}>
<Link href="/register">
<a><FontAwesomeIcon icon={faUserPlus} /> Zarejestruj się</a>
2020-01-13 16:20:19 +01:00
</Link>
</li>
</div>
</ul>
</nav>
</header>
)
}
export default Header;