issue # 로그인 페이지 라우팅
This commit is contained in:
@@ -7,6 +7,7 @@ import Layout from './layouts/Layout';
|
||||
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
|
||||
import { useAuthStore } from './store/authStore';
|
||||
import { PageRouting } from './data/RoutingData';
|
||||
import LoginPage from './ui/page/login/LoginPage';
|
||||
|
||||
function App() {
|
||||
const { authData } = useAuthStore();
|
||||
@@ -15,8 +16,9 @@ function App() {
|
||||
<Router>
|
||||
<Routes>
|
||||
<Route element={<Layout />}>
|
||||
<Route element={<LoginPage />} path={PageRouting["LOGIN"].path} />
|
||||
<Route element={<SignUpPage />} path={PageRouting["SIGN_UP"].path} />
|
||||
{!(authData?.isLogedIn) ? <Route element={<Navigate to={`/${PageRouting["SIGN_UP"].path}`} />} path="*" /> : null}
|
||||
{!(authData?.isLogedIn) ? <Route element={<Navigate to={`/${PageRouting["LOGIN"].path}`} />} path="*" /> : null}
|
||||
</Route>
|
||||
</Routes>
|
||||
</Router>
|
||||
|
||||
Reference in New Issue
Block a user