diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index 9c736580..e4440f76 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react'; +import React, { type ReactNode } from 'react'; import Navbar from './Navbar'; interface LayoutProps { diff --git a/frontend/src/components/Navbar.tsx b/frontend/src/components/Navbar.tsx index 83c75a2c..6d6a324d 100644 --- a/frontend/src/components/Navbar.tsx +++ b/frontend/src/components/Navbar.tsx @@ -1,12 +1,11 @@ -import { checkLogin } from '@_api/auth/authAPI'; -import React, { useEffect, useState } from 'react'; +import React from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { useAuth } from 'src/context/AuthContext'; const Navbar: React.FC = () => { const { loggedIn, userName, logout } = useAuth(); const navigate = useNavigate(); - + const handleLogout = async (e: React.MouseEvent) => { e.preventDefault(); try { diff --git a/frontend/src/context/AuthContext.tsx b/frontend/src/context/AuthContext.tsx index b4e83a61..c367b18f 100644 --- a/frontend/src/context/AuthContext.tsx +++ b/frontend/src/context/AuthContext.tsx @@ -1,13 +1,13 @@ -import React, { createContext, useState, useEffect, ReactNode, useContext } from 'react'; import { checkLogin as apiCheckLogin, login as apiLogin, logout as apiLogout } from '@_api/auth/authAPI'; -import type { LoginRequest, LoginCheckResponse } from '@_api/auth/authTypes'; +import type { LoginRequest, LoginResponse } from '@_api/auth/authTypes'; +import React, { createContext, useContext, useEffect, useState, type ReactNode } from 'react'; interface AuthContextType { loggedIn: boolean; userName: string | null; role: 'ADMIN' | 'MEMBER' | null; loading: boolean; // Add loading state to type - login: (data: LoginRequest) => Promise; + login: (data: LoginRequest) => Promise; logout: () => Promise; checkLogin: () => Promise; } diff --git a/frontend/src/pages/admin/AdminLayout.tsx b/frontend/src/pages/admin/AdminLayout.tsx index 26987dbe..47034a06 100644 --- a/frontend/src/pages/admin/AdminLayout.tsx +++ b/frontend/src/pages/admin/AdminLayout.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from 'react'; +import React, { type ReactNode } from 'react'; import AdminNavbar from './AdminNavbar'; interface AdminLayoutProps {