Created
October 20, 2020 14:44
-
-
Save AlxGolubev/c28bad6934274f258a015f2c2ea8cd41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ACTIONS from 'store/actions' | |
const Navbar = (props) => ( | |
const { user, role } = props | |
const logout = () => { | |
diaptch(ACTIONS.LOGOUT, { user: user }) | |
} | |
return ( | |
<div class="navbar"> | |
<Link to="/profile" onClick={logout()}>Profile</Link> | |
{ role === 'admin' && <Link to="/admin"> } | |
</div> | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment