diff --git a/app/components/Navbar/index.tsx b/app/components/Navbar/index.tsx index 3956a3b..ee993ca 100644 --- a/app/components/Navbar/index.tsx +++ b/app/components/Navbar/index.tsx @@ -1,4 +1,4 @@ -import { Link } from "@remix-run/react"; +import { Link, useNavigate } from "@remix-run/react"; import { LogOut, Tickets, UserIcon, VenetianMaskIcon } from "lucide-react"; import { useMemo, useState } from "react"; @@ -18,6 +18,7 @@ import { ThemeSwitcher } from "./ThemeSwitcher"; import type { NavbarMenuItem } from "./types"; export const Navbar = () => { + const navigate = useNavigate(); const isLogged = useIsLoggedIn(); const isAuthReady = useIsAuthReady(); const myProfile = useMyProfileQuery({ @@ -87,6 +88,7 @@ export const Navbar = () => { icon: , onClick: () => { logout().catch(console.error); + navigate(urls.home); }, }, ], @@ -104,6 +106,7 @@ export const Navbar = () => { isLogged, myProfile?.data?.me?.isSuperAdmin, setImpersonation, + navigate, ], );