diff --git a/src/pages/SignUpPage/SignUpLayout.tsx b/src/pages/SignUpPage/SignUpLayout.tsx index 9590790..6027733 100644 --- a/src/pages/SignUpPage/SignUpLayout.tsx +++ b/src/pages/SignUpPage/SignUpLayout.tsx @@ -2,27 +2,24 @@ import Header from '@/components/common/Header/Header'; import ProgressBar from '@/components/SignUp/ProgressBar'; import { Outlet, useLocation } from 'react-router-dom'; +const stepPaths = [ + '/signup/birthday-gender', + '/signup/phone-number', + '/signup/mbti', + '/signup/nickname', + '/signup/student-id', + '/signup/profile-image', +]; + const SignupLayout: React.FC = () => { const location = useLocation(); - const stepPaths = [ - '/signup/birthday-gender', - '/signup/phone-number', - '/signup/mbti', - '/signup/nickname', - '/signup/student-id', - '/signup/profile-image', - ]; - const currentStepIndex = stepPaths.indexOf(location.pathname); const progress = ((currentStepIndex + 1) / stepPaths.length) * 100; return (
-
0} - onBackClick={() => window.history.back()} - /> +
window.history.back()} /> diff --git a/src/routes/route.tsx b/src/routes/route.tsx index 048f6d5..13ce27f 100644 --- a/src/routes/route.tsx +++ b/src/routes/route.tsx @@ -1,4 +1,4 @@ -import { createBrowserRouter } from 'react-router-dom'; +import { createBrowserRouter, Navigate } from 'react-router-dom'; import Home from '@/pages/Home'; import Intro from '@/pages/SignUpPage/Intro'; import PolicyDetails from '@/pages/SignUpPage/PolicyDetails'; @@ -19,30 +19,13 @@ const router = createBrowserRouter([ path: '/signup', element: , children: [ - { - path: 'birthday-gender', - element: , - }, - { - path: 'phone-number', - element: , - }, - { - path: 'mbti', - element: , - }, - { - path: 'nickname', - element: , - }, - { - path: 'student-id', - element: , - }, - { - path: 'profile-img', - element: , - }, + { index: true, element: }, + { path: 'birthday-gender', element: }, + { path: 'phone-number', element: }, + { path: 'mbti', element: }, + { path: 'nickname', element: }, + { path: 'student-id', element: }, + { path: 'profile-img', element: }, ], }, {