summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/navigation/Navbar.js
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-web/opendc-web-ui/src/components/navigation/Navbar.js')
-rw-r--r--opendc-web/opendc-web-ui/src/components/navigation/Navbar.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/navigation/Navbar.js b/opendc-web/opendc-web-ui/src/components/navigation/Navbar.js
index f16a3feb..5c9ea1b8 100644
--- a/opendc-web/opendc-web-ui/src/components/navigation/Navbar.js
+++ b/opendc-web/opendc-web-ui/src/components/navigation/Navbar.js
@@ -15,7 +15,7 @@ import Login from '../../containers/auth/Login'
import Logout from '../../containers/auth/Logout'
import ProfileName from '../../containers/auth/ProfileName'
import { login, navbar, opendcBrand } from './Navbar.module.scss'
-import { useIsLoggedIn } from '../../auth'
+import { useAuth } from '../../auth'
export const NAVBAR_HEIGHT = 60
@@ -44,10 +44,10 @@ export const NavItem = ({ route, children }) => {
export const LoggedInSection = () => {
const router = useRouter()
- const isLoggedIn = useIsLoggedIn()
+ const { isAuthenticated } = useAuth()
return (
<Nav navbar className="auth-links">
- {isLoggedIn ? (
+ {isAuthenticated ? (
[
router.asPath === '/' ? (
<NavItem route="/projects" key="projects">
@@ -58,12 +58,10 @@ export const LoggedInSection = () => {
</Link>
</NavItem>
) : (
- <NavItem route="/profile" key="profile">
- <Link href="/profile">
- <NavLink title="My Profile">
- <ProfileName />
- </NavLink>
- </Link>
+ <NavItem key="profile">
+ <NavLink title="My Profile">
+ <ProfileName />
+ </NavLink>
</NavItem>
),
<NavItem route="logout" key="logout">