Skip to content

Commit

Permalink
[#65] feat: 서비스 수정 페이지 URI 수정
Browse files Browse the repository at this point in the history
- 서비스 아이디를 param으로 받도록 수정
- 라우터 경로에 웹팩 설정 관련 오류가 있어 index.html 수정
  • Loading branch information
Seogeurim committed Dec 28, 2021
1 parent 7899a06 commit 5e1cb8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="<%= PUBLIC_URL %>/favicon.png" />
<title>Telbby</title>
<base href="/" />
</head>
<body>
<div id="root"></div>
Expand Down
11 changes: 8 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { FC } from 'react';
import { Route, Switch } from 'react-router-dom';

import { useUserStateValue } from './atoms/userState';
import ErrorBoundary from './components/common/ErrorBoundary';
import PrivateRoute from './components/common/PrivateRoute';
import Uri from './constants/uri';
import HomePage from './pages/HomePage';
import NotFoundPage from './pages/NotFoundPage';
import ServiceEditPage from './pages/ServiceEditPage';
import ServicePage from './pages/ServicePage';
import SigninPage from './pages/SigninPage';
import SignupPage from './pages/SignupPage';
import PrivateRoute from './components/common/PrivateRoute';
import { useUserStateValue } from './atoms/userState';

const App: FC = () => {
const user = useUserStateValue();
Expand Down Expand Up @@ -39,7 +39,12 @@ const App: FC = () => {
component={ServicePage}
isAccessible={isAuthenticated}
/>
<Route path={Uri.serviceEdit} exact component={ServiceEditPage} />
{/* TODO: PrivateRoute로 바꾸기 */}
<Route
path={`${Uri.service}/:serviceId`}
exact
component={ServiceEditPage}
/>
<Route component={NotFoundPage} />
</Switch>
</ErrorBoundary>
Expand Down
1 change: 0 additions & 1 deletion src/constants/uri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ enum Uri {
signin = '/signin',
signup = '/signup',
service = '/service',
serviceEdit = '/service-edit',
}

export default Uri;

0 comments on commit 5e1cb8e

Please sign in to comment.