diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 8906839..5999a9e 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react' -import { Link, useLocation } from 'react-router-dom' +import { Link, useLocation, useNavigate } from 'react-router-dom' import api from '@/services/api' import type { User } from '@/types' @@ -10,6 +10,7 @@ interface Props { export default function Sidebar({ user, onLogout }: Props) { const { pathname } = useLocation() + const navigate = useNavigate() const [unreadCount, setUnreadCount] = useState(0) useEffect(() => { @@ -51,12 +52,14 @@ export default function Sidebar({ user, onLogout }: Props) { ))} - {user && ( -