diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index d9a3898..eccd958 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -8,31 +8,30 @@ function Home() { 소개글~ - - - - + ) @@ -44,7 +43,6 @@ const StyledHome = styled.div` align-items: center; flex-direction: column; gap: 20px; - width: 100%; height: 100vh; ` @@ -55,19 +53,16 @@ const ButtonWrapper = styled.div` align-items: center; flex-direction: column; gap: 10px; - width: 100%; ` -const Button = styled.button<{ isSignin: boolean }>` +const SignButton = styled.button<{ isSignin: boolean }>` width: 100%; height: 32px; max-width: 425px; - - cursor: pointer; - border: 1px solid gray; border-radius: 5px; + cursor: pointer; ${({ isSignin }) => css` background-color: ${isSignin ? 'black' : 'white'}; diff --git a/src/pages/PageRouter.tsx b/src/pages/PageRouter.tsx index 520447b..5d9c4b6 100644 --- a/src/pages/PageRouter.tsx +++ b/src/pages/PageRouter.tsx @@ -5,27 +5,50 @@ import Todo from './Todo' import Signin from './Signin' import Signup from './Signup' -interface IPublicRoute { - isSignIn: boolean +interface RouteProps { + isAuth: string | null + fallback: string + children: JSX.Element +} + +function ProtectedRoute({ isAuth, fallback, children }: RouteProps) { + return isAuth ? children : +} +function PublicRoute({ isAuth, fallback, children }: RouteProps) { + return isAuth ? : children } function PageRouter() { const isAuth = localStorage.getItem('access_token') - function ProtectedRoute() { - return isAuth ? : - } - function PublicRoute({ isSignIn }: IPublicRoute) { - return isAuth ? : isSignIn ? : - } - return ( } /> - } /> - } /> - } /> + + + + } + /> + + + + } + /> + + + + } + /> ) diff --git a/src/pages/Signin.tsx b/src/pages/Signin.tsx index cfb16cd..fec89a5 100644 --- a/src/pages/Signin.tsx +++ b/src/pages/Signin.tsx @@ -14,6 +14,14 @@ function Signin() { > 홈으로 + ) } @@ -21,9 +29,7 @@ function Signin() { const SampleButton = styled.div` width: fit-content; height: fit-content; - background-color: skyblue; - cursor: pointer; ` diff --git a/src/pages/Signup.tsx b/src/pages/Signup.tsx index 43ea17f..97abbd7 100644 --- a/src/pages/Signup.tsx +++ b/src/pages/Signup.tsx @@ -21,9 +21,7 @@ function Signup() { const SampleButton = styled.div` width: fit-content; height: fit-content; - background-color: skyblue; - cursor: pointer; ` diff --git a/src/pages/Todo.tsx b/src/pages/Todo.tsx index 669b207..7b5aca4 100644 --- a/src/pages/Todo.tsx +++ b/src/pages/Todo.tsx @@ -1,9 +1,21 @@ +import { useNavigate } from 'react-router-dom' import TodoList from '../components/TodoList/TodoList' function Todo() { + const navigate = useNavigate() + return (
+ 투두리스트 페이지입니다. +
) }