Skip to content

Commit

Permalink
Feat/16 (#23)
Browse files Browse the repository at this point in the history
* feat: pathname 상수 추가

* feat(common): layout component 파일 추가

* chore(common): 라우팅을 위한 각 페이지 컴포넌트 추가

* feat(common): react-router 추가

* chore(common): pnpm version 및 pnpm-lock file 수정

* feat(common): 봉사자 앱 pathname 상수 추가

* chore(common): 봉사자앱 라우팅을 위한 각 페이지 컴포넌트 추가

* feat(common): 봉사자앱 라우터 추가

* feat(volunteer): 봉사자앱  App.tsx 에 routerProvider 추가
  • Loading branch information
kutta97 authored Nov 1, 2023
1 parent 6e5a018 commit 2ec921c
Show file tree
Hide file tree
Showing 53 changed files with 732 additions and 341 deletions.
8 changes: 4 additions & 4 deletions apps/shelter/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ChakraProvider } from '@chakra-ui/react';
import { CustomButton, Header } from 'ui';
import { RouterProvider } from 'react-router-dom';

import { router } from '@/routes';

export default function App() {
return (
<ChakraProvider>
<Header />
보호소 어플리케이션
<CustomButton />
<RouterProvider router={router} />
</ChakraProvider>
);
}
40 changes: 40 additions & 0 deletions apps/shelter/src/constants/path.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const PATH = {
VOLUNTEERS: {
INDEX: 'volunteers',
DETAIL: ':id',
PROFILE: 'profile',
SEARCH: 'search',
WRITE: 'write',
UPDATE: 'write/:id',
},
ANIMALS: {
INDEX: 'animals',
DETAIL: ':id',
SEARCH: 'search',
WRITE: 'write',
UPDATE: 'write/:id',
},
CHATTINGS: {
INDEX: 'chattings',
ROOM: 'chattings/:id',
},
MYPAGE: {
INDEX: 'mypage',
REVIEWS: 'mypage/reviews',
},
SETTINGS: {
INDEX: 'settings',
ACCOUNT: 'account',
PASSWORD: 'password',
},
MANAGE: {
INDEX: 'manage',
ATTENDANCE: 'attendance/:id',
APPLY: 'apply/:id',
},
NOTIFICATIONS: 'notifications',
SIGNUP: 'signup',
SIGNIN: 'signin',
};

export default PATH;
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/animals/detail/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function AnimalsDetailPage() {
return <h1>AnimalsDetailPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/animals/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function AnimalsPage() {
return <h1>AnimalsPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/animals/searchPage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function AnimalsSearchPage() {
return <h1>AnimalsSearchPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/animals/update/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function AnimalsUpdatePage() {
return <h1>AnimalsUpdatePage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/animals/write/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function AnimalsWritePage() {
return <h1>AnimalsWritePage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/chattings/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ChattingsPage() {
return <h1>ChattingsPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/chattings/room/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ChattingsRoomPage() {
return <h1>ChattingsRoomPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/manage/apply/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ManageApplyPage() {
return <h1>ManageApplyPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/manage/attendance/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ManageAttendancePage() {
return <h1>ManageAttendancePage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/my/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function MyPage() {
return <h1>MyPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/my/reviews/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function MyReviewsPage() {
return <h1>MyReviewsPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/notfound/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function NotFoundPage() {
return <h1>NotFoundPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/notifications/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function NotificationsPage() {
return <h1>NotificationsPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/settings/account/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SettingsAccountPage() {
return <h1>SettingsAccountPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/settings/password/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SettingsPasswordPage() {
return <h1>SettingsPasswordPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/signin/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SigninPage() {
return <h1>SigninPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/signup/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SignupPage() {
return <h1>SignupPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/volunteers/detail/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function VolunteersDetailPage() {
return <h1>VolunteersDetailPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/volunteers/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function VolunteersPage() {
return <h1>VolunteersPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/volunteers/profile/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function VolunteersProfilePage() {
return <h1>VolunteersProfilePage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/volunteers/search/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function VolunteersSearchPage() {
return <h1>VolunteersSearchPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/volunteers/update/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function VolunteersUpdatePage() {
return <h1>VolunteersUpdatePage</h1>;
}
3 changes: 3 additions & 0 deletions apps/shelter/src/pages/volunteers/write/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function VolunteersWritePage() {
return <h1>VolunteersWritePage</h1>;
}
88 changes: 88 additions & 0 deletions apps/shelter/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import { createBrowserRouter } from 'react-router-dom';
import Layout from 'ui/layout';

import PATH from '@/constants/path';
import AnimalsPage from '@/pages/animals';
import AnimalsDetailPage from '@/pages/animals/detail';
import AnimalsSearchPage from '@/pages/animals/searchPage';
import AnimalsUpdatePage from '@/pages/animals/update';
import AnimalsWritePage from '@/pages/animals/write';
import ChattingsPage from '@/pages/chattings';
import ChattingsRoomPage from '@/pages/chattings/room';
import ManageAttendancePage from '@/pages/manage/attendance';
import MyPage from '@/pages/my';
import MyReviewsPage from '@/pages/my/reviews';
import NotFoundPage from '@/pages/notfound';
import NotificationsPage from '@/pages/notifications';
import SettingsAccountPage from '@/pages/settings/account';
import SettingsPasswordPage from '@/pages/settings/password';
import SigninPage from '@/pages/signin';
import SignupPage from '@/pages/signup';
import VolunteersPage from '@/pages/volunteers';
import VolunteersDetailPage from '@/pages/volunteers/detail';
import VolunteersProfilePage from '@/pages/volunteers/profile';
import VolunteersSearchPage from '@/pages/volunteers/search';
import VolunteersUpdatePage from '@/pages/volunteers/update';
import VolunteersWritePage from '@/pages/volunteers/write';

export const router = createBrowserRouter([
{
path: '/',
element: <Layout />,
errorElement: <NotFoundPage />,
children: [
{
path: PATH.VOLUNTEERS.INDEX,
children: [
{ index: true, element: <VolunteersPage /> },
{ path: PATH.VOLUNTEERS.DETAIL, element: <VolunteersDetailPage /> },
{ path: PATH.VOLUNTEERS.PROFILE, element: <VolunteersProfilePage /> },
{ path: PATH.VOLUNTEERS.SEARCH, element: <VolunteersSearchPage /> },
{ path: PATH.VOLUNTEERS.WRITE, element: <VolunteersWritePage /> },
{ path: PATH.VOLUNTEERS.UPDATE, element: <VolunteersUpdatePage /> },
],
},
{
path: PATH.ANIMALS.INDEX,
children: [
{ index: true, element: <AnimalsPage /> },
{ path: PATH.ANIMALS.DETAIL, element: <AnimalsDetailPage /> },
{ path: PATH.ANIMALS.SEARCH, element: <AnimalsSearchPage /> },
{ path: PATH.ANIMALS.WRITE, element: <AnimalsWritePage /> },
{ path: PATH.ANIMALS.UPDATE, element: <AnimalsUpdatePage /> },
],
},
{
path: PATH.CHATTINGS.INDEX,
children: [
{ index: true, element: <ChattingsPage /> },
{ path: PATH.CHATTINGS.ROOM, element: <ChattingsRoomPage /> },
],
},
{
path: PATH.MYPAGE.INDEX,
children: [
{ index: true, element: <MyPage /> },
{ path: PATH.MYPAGE.REVIEWS, element: <MyReviewsPage /> },
],
},
{
path: PATH.SETTINGS.INDEX,
children: [
{ path: PATH.SETTINGS.ACCOUNT, element: <SettingsAccountPage /> },
{ path: PATH.SETTINGS.PASSWORD, element: <SettingsPasswordPage /> },
],
},
{
path: PATH.MANAGE.INDEX,
children: [
{ path: PATH.MANAGE.ATTENDANCE, element: <ManageAttendancePage /> },
{ path: PATH.MANAGE.APPLY, element: <ManageAttendancePage /> },
],
},
{ path: PATH.NOTIFICATIONS, element: <NotificationsPage /> },
{ path: PATH.SIGNUP, element: <SignupPage /> },
{ path: PATH.SIGNIN, element: <SigninPage /> },
],
},
]);
8 changes: 4 additions & 4 deletions apps/volunteer/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ChakraProvider } from '@chakra-ui/react';
import { CustomButton, Header } from 'ui';
import { RouterProvider } from 'react-router-dom';

import { router } from '@/routes';

export default function App() {
return (
<ChakraProvider>
<Header />
봉사자 어플리케이션
<CustomButton />
<RouterProvider router={router} />
</ChakraProvider>
);
}
35 changes: 35 additions & 0 deletions apps/volunteer/src/constants/path.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const PATH = {
VOLUNTEERS: {
INDEX: 'volunteers',
DETAIL: ':id',
SEARCH: 'search',
},
ANIMALS: {
INDEX: 'animals',
DETAIL: ':id',
},
CHATTINGS: {
INDEX: 'chattings',
ROOM: 'chattings/:id',
},
MYPAGE: {
INDEX: 'mypage',
REVIEWS: 'mypage/reviews',
},
SETTINGS: {
INDEX: 'settings',
ACCOUNT: 'account',
PASSWORD: 'password',
},
SHELTERS: {
INDEX: 'shelters',
PROFILE: 'profile/:id',
REVIEWS_WRITE: 'reviews/write',
REVIEWS_UPDATE: 'reviews/write/:id',
},
NOTIFICATIONS: 'notifications',
SIGNUP: 'signup',
SIGNIN: 'signin',
};

export default PATH;
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/animals/detail/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function AnimalsDetailPage() {
return <h1>AnimalsDetailPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/animals/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function AnimalsPage() {
return <h1>AnimalsPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/chattings/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ChattingsPage() {
return <h1>ChattingsPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/chattings/room/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ChattingsRoomPage() {
return <h1>ChattingsRoomPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/my/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function MyPage() {
return <h1>MyPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/notfound/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function NotFoundPage() {
return <h1>NotFoundPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/notifications/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function NotificationsPage() {
return <h1>NotificationsPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/settings/account/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SettingsAccountPage() {
return <h1>SettingsAccountPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/settings/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SettingsPage() {
return <h1>SettingsPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/settings/password/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SettingsPasswordPage() {
return <h1>SettingsPasswordPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/shelters/profile/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SheltersProfilePage() {
return <h1>SheltersProfilePage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/shelters/reviews/update/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SheltersReviewsUpdatePage() {
return <h1>SheltersReviewsUpdatePage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/shelters/reviews/write/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SheltersReviewsWritePage() {
return <h1>SheltersReviewsWritePage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/signin/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SigninPage() {
return <h1>SigninPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/signup/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function SignupPage() {
return <h1>SignupPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/volunteers/detail/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function VolunteersDetailPage() {
return <h1>VolunteersDetailPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/volunteers/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function VolunteersPage() {
return <h1>VolunteersPage</h1>;
}
3 changes: 3 additions & 0 deletions apps/volunteer/src/pages/volunteers/search/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function VolunteersSearchPage() {
return <h1>VolunteersSearchPage</h1>;
}
Loading

0 comments on commit 2ec921c

Please sign in to comment.