Skip to content

Commit

Permalink
Merge pull request #281 from woowacourse-teams/fix/#279
Browse files Browse the repository at this point in the history
변수 불일치 버그 수정, 해주세요 만들기 페이지 라우터 연결
  • Loading branch information
cys4585 authored Aug 8, 2024
2 parents 54422f8 + 76f237d commit f701218
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/src/constants/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const ROUTES = {
chat: '/chat',
chattingRoom: '/chatting-room/:moimId',
please: '/please',
addPlease: '/please/creation',
myPage: '/my-page',
};

Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/MoimCreationPage/MoimCreationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function MoimCreationPage() {
<LabeledInput
name={info.name}
title={info.title}
type={info.type}
key={info.title}
required={info.required}
placeholder={info.placeholder}
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/PleaseCreationPage/PleaseCreationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ export default function PleaseCreationPage() {
const navigate = useNavigate();
const [isSubmitted, setIsSubmitted] = useState(false);
const { mutate } = useAddPlease(() => {
navigate(-1);
navigate(ROUTES.please);
});

const {
inputData,
handleInputChange,
handleTextAreaChange,
isValidMoimInfoInput,
isValidPleaseInfoInput,
} = usePleaseInfoInput();

const handleRegisterButtonClick = async () => {
if (!isValidMoimInfoInput) {
if (!isValidPleaseInfoInput) {
return;
}
if (isSubmitted) return;
Expand Down Expand Up @@ -69,7 +69,7 @@ export default function PleaseCreationPage() {
<Button
shape="bar"
onClick={handleRegisterButtonClick}
disabled={!isValidMoimInfoInput}
disabled={!isValidPleaseInfoInput}
>
등록하기
</Button>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/PleasePage/PleasePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function PleasePage() {
</PleaseLayout.Main>

<PleaseLayout.HomeFixedButtonWrapper>
<PlusButton onClick={() => navigate(ROUTES.please)} />
<PlusButton onClick={() => navigate(ROUTES.addPlease)} />
</PleaseLayout.HomeFixedButtonWrapper>
</PleaseLayout>
<NavigationBarWrapper>
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/routes/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { createBrowserRouter } from 'react-router-dom';
import PleasePage from '@_pages/PleasePage/PleasePage';
import MyPage from '@_pages/Mypage/MyPage';
import RouteChangeTracker from '../RouteChageTracker';
import PleaseCreationPage from '@_pages/PleaseCreationPage/PleaseCreationPage';

const routesConfig = [
{
Expand Down Expand Up @@ -59,6 +60,11 @@ const routesConfig = [
element: <PleasePage />,
requiresAuth: true,
},
{
path: ROUTES.addPlease,
element: <PleaseCreationPage />,
requiresAuth: true,
},
{
path: ROUTES.myPage,
element: <MyPage />,
Expand Down

0 comments on commit f701218

Please sign in to comment.