Skip to content

Commit 1147372

Browse files
authored
Router conflict 해결 (#72)
* fix: router에 createPage import 추가 * fix: create 페이지 이동 추가
1 parent 8b79d58 commit 1147372

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/pages/MainPage/MainPage.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1+
import { useNavigate } from 'react-router-dom';
2+
13
import { Button } from '@components/shared/Button';
24
import { Header } from '@components/shared/Header';
35
import { MatchItem } from '@components/shared/MatchItem';
46
import { Text } from '@components/shared/Text';
57

68
import { theme } from '@styles/theme';
79

10+
import { PATH_NAME } from '@consts/pathName';
11+
812
import { MainPageContainer, MainPageSubContainer } from './MainPage.style';
913

1014
export const MainPage = () => {
15+
const navigate = useNavigate();
1116
return (
1217
<MainPageContainer>
1318
<Header isLogo={true} />
@@ -35,7 +40,10 @@ export const MainPage = () => {
3540
/>
3641
)
3742
)}
38-
<Button {...MAIN_PAGE_BUTTON_PROP}></Button>
43+
<Button
44+
{...MAIN_PAGE_BUTTON_PROP}
45+
handleClick={() => navigate(PATH_NAME.GAMES_NEAR)}
46+
></Button>
3947
</MainPageSubContainer>
4048
<MainPageSubContainer>
4149
<Text children={'추천 크루'} weight={700} size={'1.25rem'} />
@@ -61,7 +69,10 @@ export const MainPage = () => {
6169
/>
6270
)
6371
)}
64-
<Button {...MAIN_PAGE_BUTTON_PROP}></Button>
72+
<Button
73+
{...MAIN_PAGE_BUTTON_PROP}
74+
handleClick={() => console.log('hi')}
75+
></Button>
6576
</MainPageSubContainer>
6677
</MainPageContainer>
6778
);
@@ -116,5 +127,4 @@ const MAIN_PAGE_BUTTON_PROP = {
116127
textColor: `${theme.PALETTE.RED_400}`,
117128
borderColor: `${theme.PALETTE.RED_400}`,
118129
backgroundColor: 'white',
119-
handleClick: () => console.log('hi'),
120130
};

src/routes/router.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import { Suspense } from 'react';
22
import { createBrowserRouter } from 'react-router-dom';
33

44
import { CreateGamePage } from '@pages/CreateGamePage';
5+
import { CreatePage } from '@pages/CreatePage';
56
import { GamesDetailPage } from '@pages/GamesDetailPage';
67
import { GamesNearPage } from '@pages/GamesNearPage';
78
import { Layout } from '@pages/Layout';
8-
import { ManagePage } from '@pages/ManagePage';
99
import { LoginPage } from '@pages/LoginPage';
1010
import { MainPage } from '@pages/MainPage';
11+
import { ManagePage } from '@pages/ManagePage';
1112
import { RegisterPage } from '@pages/RegisterPage';
1213

1314
export const router = createBrowserRouter([

0 commit comments

Comments
 (0)