Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"dependencies": {
"eslint-import-resolver-typescript": "^4.4.4",
"react": "^19.2.0",
"react-dom": "^19.2.0"
"react-dom": "^19.2.0",
"react-router-dom": "^7.11.0"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
Expand Down
45 changes: 45 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { HomePage } from "@/pages/home/home-page";
import { RouterProvider } from "react-router-dom";

Check warning on line 1 in src/app/App.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

There should be at least one empty line between import groups
import { router } from "./routes/app-routes";

const App = () => {
return (
<>
<HomePage />
<RouterProvider router={router} />
</>
);
};
Expand Down
17 changes: 17 additions & 0 deletions src/app/routes/app-routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { createBrowserRouter } from "react-router-dom";

Check warning on line 1 in src/app/routes/app-routes.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

There should be at least one empty line between import groups
import { publicRoutes } from "./public-routes";
import { protectedRoutes } from "./protected-routes";

Check warning on line 3 in src/app/routes/app-routes.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

`./protected-routes` import should occur before import of `./public-routes`

export const router = createBrowserRouter([
{
path: "/",
// element: <RootLayout />, TODO: RootLayout 추가
children: [
...publicRoutes,

// TODO: auth에 따른 처리 추가
...protectedRoutes,
// TODO: paths 이외의 경로 접근 시 error 처리
],
},
]);
18 changes: 18 additions & 0 deletions src/app/routes/paths.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const ROUTES = {
HOME: "/",
LOGIN: "/login",
ONBOARDING: "/onboarding",
COMPANY: (id = ":id") => `/company/${id}`, // 기업 상세
EXPERIENCE_MATCHING: "/experience-matching", // 경험x기업 매칭

MATCHLING_LIST: "/matching", // 경험x기업 매칭 결과 리스트
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분 오타 있는 것 같습니다!! MATCHING_LIST로 바꾸면 될 것 같아요 ☺️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

매칠링~ 감사합니다 ^-^!!!!

MATCHING_DETAIL: (id = ":id") => `/matching/${id}`, // 매칭 결과 상세

EXPERIENCE: "/experience", // 경험 목록
EXPERIENCE_CREATE: "/experience/create", // 경험 생성
EXPERIENCE_DETAIL: (id = ":id") => `/experience/${id}`, // 경험 상세
EXPERIENCE_EDIT: (id = ":id") => `/experience/${id}/edit`, // 경험 수정

MYPAGE: "/mypage",
BOOKMARK: "/bookmark",
};
45 changes: 45 additions & 0 deletions src/app/routes/protected-routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { ROUTES } from "./paths";

import { HomePage } from "@/pages/home/home-page";

Check warning on line 3 in src/app/routes/protected-routes.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

`@/pages/home/home-page` import should occur before import of `./paths`
import { OnboardingPage } from "@/pages/onboarding/onboarding-page";

Check warning on line 4 in src/app/routes/protected-routes.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

`@/pages/onboarding/onboarding-page` import should occur before import of `./paths`
import { CompanyDetailPage } from "@/pages/company-detail/company-detail-page";

Check warning on line 5 in src/app/routes/protected-routes.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

`@/pages/company-detail/company-detail-page` import should occur before import of `./paths`

Check warning on line 5 in src/app/routes/protected-routes.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

There should be no empty line within import group

import { ExperienceMatchingPage } from "@/pages/experience-matching/experience-matching-page";

Check warning on line 7 in src/app/routes/protected-routes.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

`@/pages/experience-matching/experience-matching-page` import should occur before import of `./paths`
import { MatchingListPage } from "@/pages/matching-list/matching-list-page";

Check warning on line 8 in src/app/routes/protected-routes.tsx

View workflow job for this annotation

GitHub Actions / build-and-deploy

`@/pages/matching-list/matching-list-page` import should occur before import of `./paths`
import { MatchingDetailPage } from "@/pages/matching-detail/matching-detail-page";

import { ExperienceDetailPage } from "@/pages/experience-detail/ui/experience-page/experience-detail-page";
import { ExperiencePage } from "@/pages/experience/experience-page";

import { MyPage } from "@/pages/my-page/my-page";
import { BookmarkPage } from "@/pages/bookmark/bookmark-page";

export const protectedRoutes = [
{ path: ROUTES.HOME, element: <HomePage /> },
{ path: ROUTES.ONBOARDING, element: <OnboardingPage /> },

{ path: ROUTES.COMPANY(), element: <CompanyDetailPage /> },
{ path: ROUTES.EXPERIENCE_MATCHING, element: <ExperienceMatchingPage /> },

// 매칭 결과
{ path: ROUTES.MATCHLING_LIST, element: <MatchingListPage /> },
{ path: ROUTES.MATCHING_DETAIL(), element: <MatchingDetailPage /> },

// 경험
{ path: ROUTES.EXPERIENCE, element: <ExperiencePage /> },
{
path: ROUTES.EXPERIENCE_CREATE,
element: <ExperienceDetailPage mode="create" />,
},
{
path: ROUTES.EXPERIENCE_DETAIL(),
element: <ExperienceDetailPage mode="view" />,
},
{
path: ROUTES.EXPERIENCE_EDIT(),
element: <ExperienceDetailPage mode="edit" />,
},

{ path: ROUTES.MYPAGE, element: <MyPage /> },
{ path: ROUTES.BOOKMARK, element: <BookmarkPage /> },
];
6 changes: 6 additions & 0 deletions src/app/routes/public-routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ROUTES } from "./paths";
import { LoginPage } from "@/pages/login/login-page";

export const publicRoutes = [
{ path: ROUTES.LOGIN, element: <LoginPage /> },
];
Empty file removed src/pages/bookmark/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions src/pages/bookmark/bookmark-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const BookmarkPage = () => {
return (
<div>
<h1>Welcome to the Bookmark Page</h1>
</div>
);
};

export { BookmarkPage };
Empty file removed src/pages/company-analyze/.gitkeep
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기업 분석 세부 페이지에 대한 라우팅은 company-detail로 처리되고 있는 것 같은데,
혹시 같은 의미로 구성하신 폴더라면 제거해줘도 좋을 것 같아요 ❣️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

크아악 초기 세팅할 당시에 만들었던 파일인데 제거하는 걸 깜빡했네요 감사합니다 !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로컬에서 해당 폴더가 추적이 안 돼서 보이지 않네요 .. 🥲 추후에 다른 작업 진행하면서 제거 해도 괜찮을까요?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아이구 물론입니다~ ^0^

Empty file.
12 changes: 12 additions & 0 deletions src/pages/company-detail/company-detail-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { useParams } from "react-router-dom";

const CompanyDetailPage = () => {
const { id } = useParams();
return (
<div>
<h1>Company Detail Page - {id}</h1>
</div>
);
};

export { CompanyDetailPage };
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { useParams } from "react-router-dom";
import { ExperienceForm } from "./experience-form";
import { ExperienceViewer } from "./experience-viewer";

type mode = "view" | "edit" | "create";

interface ExperiencePageProps {
mode: mode;
}

const ExperienceDetailPage = ({ mode }: ExperiencePageProps) => {
const { id } = useParams<{ id: string }>();
switch (mode) {
case "view":
return <ExperienceViewer />;

case "create":
case "edit":
return <ExperienceForm mode={mode} id={id} />;
}
};

export { ExperienceDetailPage };
19 changes: 19 additions & 0 deletions src/pages/experience-detail/ui/experience-page/experience-form.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
type mode = "create" | "edit";

interface ExperienceFormProps {
mode: mode;
id?: string;
}

const ExperienceForm = ({ mode, id }: ExperienceFormProps) => {
// TODO: mode에 따라 isEdit 모드 분기 처리
return (
<div>
<h1>
Experience Form - {mode} {mode === "edit" && `${id}`}
</h1>
</div>
);
};

export { ExperienceForm };
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { useParams } from "react-router-dom";

const ExperienceViewer = () => {
const { id } = useParams();
return (
<div>
<h1>Experience Viewer - {id}</h1>
</div>
);
};

export { ExperienceViewer };
9 changes: 9 additions & 0 deletions src/pages/experience-matching/experience-matching-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const ExperienceMatchingPage = () => {
return (
<div>
<h1>Welcome to the Experience Matching Page</h1>
</div>
);
};

export { ExperienceMatchingPage };
Empty file removed src/pages/experience/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions src/pages/experience/experience-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const ExperiencePage = () => {
return (
<div>
<h1>Experience List Page</h1>
</div>
);
};

export { ExperiencePage };
Empty file removed src/pages/login/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions src/pages/login/login-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const LoginPage = () => {
return (
<div>
<h1>Welcome to the Login Page</h1>
</div>
);
};

export { LoginPage };
12 changes: 12 additions & 0 deletions src/pages/matching-detail/matching-detail-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { useParams } from "react-router-dom";

const MatchingDetailPage = () => {
const { id } = useParams();
return (
<div>
<h1>Welcome to the Matching Detail Page - {id}</h1>
</div>
);
};

export { MatchingDetailPage };
9 changes: 9 additions & 0 deletions src/pages/matching-list/matching-list-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const MatchingListPage = () => {
return (
<div>
<h1>Welcome to the Matching List Page</h1>
</div>
);
};

export { MatchingListPage };
Empty file removed src/pages/my-page/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions src/pages/my-page/my-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const MyPage = () => {
return (
<div>
<h1>Welcome to the My Page</h1>
</div>
);
};

export { MyPage };
Empty file removed src/pages/onboarding/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions src/pages/onboarding/onboarding-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const OnboardingPage = () => {
return (
<div>
<h1>Welcome to the Onboarding Page</h1>
</div>
);
};

export { OnboardingPage };
Empty file removed src/pages/register/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions src/pages/register/register-page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const RegisterPage = () => {
return (
<div>
<h1>Welcome to the Register Page</h1>
</div>
);
};

export { RegisterPage };
Loading