Skip to content

Instantly share code, notes, and snippets.

@AlxGolubev
Created October 20, 2020 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlxGolubev/c28bad6934274f258a015f2c2ea8cd41 to your computer and use it in GitHub Desktop.
Save AlxGolubev/c28bad6934274f258a015f2c2ea8cd41 to your computer and use it in GitHub Desktop.
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