Repository navigation
feat: 404 페이지 추가 #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: 404 페이지 추가 #43
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
31e36e5
feat: 404 페이지 추가
54df037
fix: 반려 목록 EstimatesQueryStatus 참조 복구
437a994
Merge remote-tracking branch 'origin/dev' into feat/404-page
9ed1af5
fix: 404 페이지에서 인증 가드 자동 리다이렉트 방지
ee87fbc
fix: 404·대기 견적 CodeRabbit 리뷰 반영
4d21d93
fix: 404·견적 셸 CodeRabbit 예상 지적 반영
e18ff95
fix: 반려 요청 기사 가드 및 404 이전 이동 안전성 개선
d61de77
chore: origin/dev 변경을 feat/404-page에 병합
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,18 @@ | ||
| import type { Metadata } from "next"; | ||
|
|
||
| import CustomerAuthGate from "@/components/auth/CustomerAuthGate"; | ||
| import PendingEstimatesPageClient from "@/components/estimate/pending/PendingEstimatesPageClient"; | ||
|
|
||
| export const metadata: Metadata = { | ||
| // 2026.07.31 정슬기 - [추가] 대기 중인 견적 목록 metadata | ||
| title: "대기 중인 견적", | ||
| description: "아직 확정하지 않은 대기 중인 견적 목록을 확인합니다.", | ||
| }; | ||
|
|
||
| export default function PendingEstimatesPage() { | ||
| return <PendingEstimatesPageClient />; | ||
| return ( | ||
| <CustomerAuthGate loadingMessage="견적 관리를 불러오는 중입니다."> | ||
| <PendingEstimatesPageClient /> | ||
| </CustomerAuthGate> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import type { Metadata } from "next"; | ||
|
|
||
| import NotFoundView from "@/components/common/NotFoundView"; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "404 | MOVING", | ||
| }; | ||
|
|
||
| /** | ||
| * App Router 전역 Not Found | ||
| * // 2026.07.30 정슬기 - [추가] | ||
| * // 2026.07.31 정슬기 - [수정] data-not-found-page 마커로 auth:expired 등 자동 이동 제외 | ||
| */ | ||
| export default function NotFound() { | ||
| // flex-1 체인을 main → 래퍼 → NotFoundView로 이어 세로 중앙 정렬 유지 | ||
| // // 2026.07.31 정슬기 - [수정] | ||
| return ( | ||
| <div data-not-found-page="" className="flex w-full flex-1 flex-col"> | ||
| <NotFoundView /> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,18 @@ | ||
| import type { Metadata } from "next"; | ||
|
|
||
| import CustomerAuthGate from "@/components/auth/CustomerAuthGate"; | ||
| import MyReviewsPageClient from "@/components/review/MyReviewsPageClient"; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "내가 작성한 리뷰", | ||
| }; | ||
|
|
||
| // 2026.07.27 정슬기 - [추가] 내가 작성한 리뷰 페이지 | ||
| // 2026.07.31 정슬기 - [수정] AuthGate를 페이지로 이동 (404가 layout 가드에 가로채지지 않도록) | ||
| export default function MyReviewsPage() { | ||
| return <MyReviewsPageClient />; | ||
| return ( | ||
| <CustomerAuthGate loadingMessage="리뷰를 불러오는 중입니다."> | ||
| <MyReviewsPageClient /> | ||
| </CustomerAuthGate> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,18 @@ | ||
| import type { Metadata } from "next"; | ||
|
|
||
| import CustomerAuthGate from "@/components/auth/CustomerAuthGate"; | ||
| import WritableReviewsPageClient from "@/components/review/WritableReviewsPageClient"; | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "작성 가능한 리뷰", | ||
| }; | ||
|
|
||
| // 2026.07.27 정슬기 - [추가] 작성 가능한 리뷰 페이지 | ||
| // 2026.07.31 정슬기 - [수정] AuthGate를 페이지로 이동 (404가 layout 가드에 가로채지지 않도록) | ||
| export default function WritableReviewsPage() { | ||
| return <WritableReviewsPageClient />; | ||
| return ( | ||
| <CustomerAuthGate loadingMessage="리뷰를 불러오는 중입니다."> | ||
| <WritableReviewsPageClient /> | ||
| </CustomerAuthGate> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| "use client"; | ||
|
|
||
| import { usePathname, useRouter } from "next/navigation"; | ||
| import { useEffect, type ReactNode } from "react"; | ||
|
|
||
| import EstimatesQueryStatus from "@/components/estimate/EstimatesQueryStatus"; | ||
| import { useCustomerAuthReady } from "@/hooks/useCustomerAuthReady"; | ||
| import { buildLoginPath } from "@/lib/auth/redirect"; | ||
| import { APP_ROUTES } from "@/lib/constants/appRoutes"; | ||
|
|
||
| interface MoverAuthGateProps { | ||
| children: ReactNode; | ||
| /** 세션 확인 중 표시. 기본은 공통 로딩 메시지 */ | ||
| loadingMessage?: string; | ||
| } | ||
|
|
||
| /** | ||
| * 기사님 전용 영역 가드 | ||
| * - 세션 복구 중: 로딩 | ||
| * - 비로그인: 로그인 페이지로 이동 (?redirect=) | ||
| * - 고객: 기사님 찾기(고객 홈)로 이동 | ||
| * // 2026.07.31 정슬기 - [추가] CustomerAuthGate와 대칭인 기사님 가드 | ||
| */ | ||
| export default function MoverAuthGate({ | ||
| children, | ||
| loadingMessage = "로그인 상태를 확인하는 중입니다.", | ||
| }: MoverAuthGateProps) { | ||
| const router = useRouter(); | ||
| const pathname = usePathname(); | ||
| const { isPending, isAuthenticated, isMover } = useCustomerAuthReady(); | ||
| const canAccess = !isPending && isAuthenticated && isMover; | ||
|
|
||
| useEffect(() => { | ||
| if (isPending) return; | ||
|
|
||
| if (!isAuthenticated) { | ||
| const search = typeof window !== "undefined" ? window.location.search : ""; | ||
| router.replace(buildLoginPath(`${pathname}${search}`)); | ||
| return; | ||
| } | ||
|
|
||
| if (!isMover) { | ||
| router.replace(APP_ROUTES.MOVERS.ROOT); | ||
| } | ||
| }, [isPending, isAuthenticated, isMover, pathname, router]); | ||
|
|
||
| if (isPending || !canAccess) { | ||
| return <EstimatesQueryStatus message={loadingMessage} />; | ||
| } | ||
|
|
||
| return children; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| "use client"; | ||
|
|
||
| import { useRouter } from "next/navigation"; | ||
|
|
||
| import Button from "@/components/common/Button/Button"; | ||
| import { Text } from "@/components/common/Text"; | ||
| import { APP_ROUTES } from "@/lib/constants/appRoutes"; | ||
|
|
||
| /** | ||
| * 전역 404 안내 UI | ||
| * // 2026.07.30 정슬기 - [추가] Empty/Error 톤에 맞춘 중앙 정렬 404 | ||
| * // 2026.07.31 정슬기 - [수정] 동일 origin referrer일 때만 back, 그 외 홈 이동 | ||
| */ | ||
| export default function NotFoundView() { | ||
| const router = useRouter(); | ||
|
|
||
| const handleBack = () => { | ||
| try { | ||
| const referrer = document.referrer; | ||
| if (referrer) { | ||
| const referrerOrigin = new URL(referrer).origin; | ||
| if (referrerOrigin === window.location.origin) { | ||
| router.back(); | ||
| return; | ||
| } | ||
| } | ||
| } catch { | ||
| // referrer URL 파싱 실패 시 홈으로 이동 | ||
| } | ||
| router.push(APP_ROUTES.HOME); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="bg-background-default px-margin-mobile md:px-margin-tablet flex w-full flex-1 flex-col items-center justify-center py-64 lg:px-0"> | ||
| <div className="max-w-container-desktop flex w-full flex-col items-center gap-32 md:gap-40"> | ||
| <div className="flex flex-col items-center gap-16 md:gap-20"> | ||
| <Text | ||
| as="h1" | ||
| variant={{ base: "3xl-bold", md: "3xl-bold" }} | ||
| className="text-text-primary text-center" | ||
| > | ||
| 404 | ||
| </Text> | ||
| <div className="flex flex-col items-center gap-8 text-center"> | ||
| <Text | ||
| as="p" | ||
| variant={{ base: "lg-semibold", md: "2lg-semibold" }} | ||
| className="text-text-primary" | ||
| > | ||
| 페이지를 찾을 수 없습니다. | ||
| </Text> | ||
| <Text | ||
| as="p" | ||
| variant={{ base: "md-regular", md: "lg-regular" }} | ||
| className="text-text-muted" | ||
| > | ||
| 입력하신 주소가 잘못되었거나 | ||
| <br /> | ||
| 페이지가 이동 또는 삭제되었을 수 있습니다. | ||
| </Text> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div className="flex w-full flex-col gap-12 sm:w-auto sm:flex-row sm:justify-center sm:gap-16"> | ||
| <Button | ||
| type="button" | ||
| variant="solid" | ||
| size="cta" | ||
| className="w-full sm:w-auto sm:min-w-160" | ||
| onClick={() => { | ||
| router.push(APP_ROUTES.HOME); | ||
| }} | ||
| > | ||
| 홈으로 이동 | ||
| </Button> | ||
| <Button | ||
| type="button" | ||
| variant="outline" | ||
| size="cta" | ||
| className="w-full sm:w-auto sm:min-w-160" | ||
| onClick={handleBack} | ||
| > | ||
| 이전 페이지로 이동 | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.