Skip to content

Commit

Permalink
fix : notfounderror 페이지 경로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yeong30 committed Dec 20, 2024
1 parent 9a6836e commit 439d4b2
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/main.hash.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { HomePage, NotFoundPage, ProfilePage, LoginPage } from "./pages/index";
import {
HomePage,
NotFoundErrorPage,
ProfilePage,
LoginPage,
} from "./pages/index";
import { HashRouter } from "./lib/hashRouter";

const hashRouter = new HashRouter();
Expand All @@ -7,5 +12,5 @@ hashRouter.createRoutes({
"/": { component: HomePage },
"/profile": { component: ProfilePage, requiresAuth: true },
"/login": { component: LoginPage },
notFound: { component: NotFoundPage },
notFound: { component: NotFoundErrorPage },
});
9 changes: 7 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { HomePage, NotFoundPage, ProfilePage, LoginPage } from "./pages/index";
import {
HomePage,
NotFoundErrorPage,
ProfilePage,
LoginPage,
} from "./pages/index";
import { Router } from "./lib/router";

const router = new Router();
Expand All @@ -7,5 +12,5 @@ router.createRoutes({
"/": { component: HomePage },
"/profile": { component: ProfilePage, requiresAuth: true },
"/login": { component: LoginPage },
notFound: { component: NotFoundPage },
notFound: { component: NotFoundErrorPage },
});
4 changes: 2 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HomePage } from "./home/HomePage";
import { LoginPage } from "./login/LoginPage";
import { ProfilePage } from "./profile/ProfilePage";
import { NotFoundPage } from "./notFound/NotFoundPage";
import { NotFoundErrorPage } from "./notFound/NotFoundErrorPage";

export { HomePage, NotFoundPage, ProfilePage, LoginPage };
export { HomePage, NotFoundErrorPage, ProfilePage, LoginPage };
16 changes: 16 additions & 0 deletions src/pages/notFound/NotFoundErrorPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export function NotFoundErrorPage() {
return `<main class="bg-gray-100 flex items-center justify-center min-h-screen">
<div class="bg-white p-8 rounded-lg shadow-md w-full text-center" style="max-width: 480px">
<h1 class="text-2xl font-bold text-blue-600 mb-4">항해플러스</h1>
<p class="text-4xl font-bold text-gray-800 mb-4">404</p>
<p class="text-xl text-gray-600 mb-8">페이지를 찾을 수 없습니다</p>
<p class="text-gray-600 mb-8">
요청하신 페이지가 존재하지 않거나 이동되었을 수 있습니다.
</p>
<a href="/" class="bg-blue-600 text-white px-4 py-2 rounded font-bold">
홈으로 돌아가기
</a>
</div>
</main>
`;
}

0 comments on commit 439d4b2

Please sign in to comment.