Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix navbar behaviour #29

Merged
merged 6 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function HamburgerMenu(props) {
<MenuList>
{routes_isLoggedIn.map((route) => (
<MenuItem
key={route.id}
key={route.key}
as={ReactRouterLink}
to={route.path}
state={{
Expand All @@ -110,7 +110,7 @@ export function HamburgerMenu(props) {
<MenuList>
{routes_notLoggedIn.map((route) => (
<MenuItem
key={route.id}
key={route.key}
as={ReactRouterLink}
to={route.path}
_activeLink={{ fontWeight: "bold", borderBottom: "2px" }}
Expand Down Expand Up @@ -155,7 +155,7 @@ export default function Navbar() {
<Hide below="md">
<Breadcrumb p="1em">
{routes_isLoggedIn.map((route) => (
<BreadcrumbItem key={route.id}>
<BreadcrumbItem key={route.key}>
<BreadcrumbLink
as={ReactRouterLink}
to={route.path}
Expand Down Expand Up @@ -206,7 +206,7 @@ export default function Navbar() {
<Hide below="md">
<Breadcrumb p="1em">
{routes_notLoggedIn.map((route) => (
<BreadcrumbItem key={route.id}>
<BreadcrumbItem key={route.key}>
<BreadcrumbLink
as={ReactRouterLink}
to={route.path}
Expand Down
10 changes: 6 additions & 4 deletions src/components/SignOutButton.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Button } from "@chakra-ui/react"

const SignOut = async () => {
localStorage.clear()
window.location.reload()
}
import { redirect } from "react-router-dom"

export function SignOutButton() {
const SignOut = async () => {
localStorage.clear()
redirect("/")
window.location.reload()
}
return <Button onClick={SignOut}>Sign out</Button>
}
Loading