-
Notifications
You must be signed in to change notification settings - Fork 2
feat: 기사님 상세·리뷰 조회 API 연동 및 로딩/에러 UI 추가 #29
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
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
461c905
feat: 기사님 상세 조회 API 연동
yooseohyeon 94a9ed2
feat: 기사님 찾기 페이지에서 카드 클릭 시 상세 페이지로 이동
yooseohyeon f26255a
feat: 기사님 리뷰 목록 API 연동 및 임시 mock 추가
yooseohyeon 1133246
chore: 기사 리뷰 목록 임시 mock 제거
yooseohyeon 1f70db6
feat: 기사 상세·리뷰 목록 로딩 스켈레톤 UI 추가
yooseohyeon 225121c
feat: 기사 상세 별점 분포 API 연동
yooseohyeon c6f7365
feat: 기사 상세 잘못된 id/조회 실패 시 EmptyState·에러 패널 표시
yooseohyeon b021505
chore: isMoverDetailId 중복 export 정리
yooseohyeon 03f5ad4
fix: 리뷰 목록이 비어 있으면 reviewCount와 무관하게 empty UI 표시 (시드 데이터 오류로 인한 임시 조치)
yooseohyeon 18e7eb2
fix: 기사님 리뷰 페이지 전환 시 로딩 처리 수정 (기존 목록 유지)
yooseohyeon c58500c
fix: 기사님 상세 재조회 실패 시 기존 화면 유지
yooseohyeon 01e57fd
fix: 기사님 에러 패널(MoversErrorPanel)에 alert role 추가
yooseohyeon 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| "use client"; | ||
|
|
||
| import { useEffect } from "react"; | ||
|
|
||
| import MoversErrorPanel from "@/components/mover/MoversErrorPanel"; | ||
|
|
||
| interface MoverDetailErrorProps { | ||
| error: Error & { digest?: string }; | ||
| reset: () => void; | ||
| } | ||
|
|
||
| export default function MoverDetailError({ error, reset }: MoverDetailErrorProps) { | ||
| useEffect(() => { | ||
| console.error(error); | ||
| }, [error]); | ||
|
|
||
| return ( | ||
| <div className="bg-background-default flex w-full flex-1 flex-col items-center justify-center"> | ||
| <MoversErrorPanel | ||
| title="불러오지 못했어요" | ||
| description="기사님 상세 페이지를 표시하는 중 문제가 발생했습니다." | ||
| actionLabel="다시 시도" | ||
| isRetrying={false} | ||
| onRetry={reset} | ||
| /> | ||
| </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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import MoverDetailNotFoundStatus from "@/components/mover/detail/MoverDetailNotFoundStatus"; | ||
|
|
||
| export default function MoverDetailNotFound() { | ||
| return <MoverDetailNotFoundStatus />; | ||
| } |
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,25 +1,24 @@ | ||
| import type { Metadata } from "next"; | ||
| import { notFound } from "next/navigation"; | ||
|
|
||
| import MoverDetailView from "@/components/mover/detail/MoverDetailView"; | ||
| import { getMockMoverDetail } from "@/components/mover/detail/moverDetailMock"; | ||
| import { isMoverDetailId } from "@/lib/utils/isMoverDetailId"; | ||
|
|
||
| interface MoverDetailPageProps { | ||
| params: Promise<{ moverId: string }>; | ||
| } | ||
|
|
||
| export async function generateMetadata({ params }: MoverDetailPageProps): Promise<Metadata> { | ||
| const { moverId } = await params; | ||
| const detail = getMockMoverDetail(moverId); | ||
| const name = detail?.name ?? "기사님"; | ||
|
|
||
| return { | ||
| title: `${name} 기사님 상세`, | ||
| description: detail?.title ?? "이사 기사님 상세 정보를 확인하세요.", | ||
| }; | ||
| } | ||
| export const metadata: Metadata = { | ||
| title: "기사님 상세", | ||
| description: "이사 기사님 상세 정보를 확인하세요.", | ||
| }; | ||
|
|
||
| export default async function MoverDetailPage({ params }: MoverDetailPageProps) { | ||
| const { moverId } = await params; | ||
|
|
||
| if (!isMoverDetailId(moverId)) { | ||
| notFound(); | ||
| } | ||
|
|
||
| return <MoverDetailView key={moverId} moverId={moverId} />; | ||
| } |
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,44 @@ | ||
| "use client"; | ||
|
|
||
| import Button from "@/components/common/Button/Button"; | ||
| import { Text } from "@/components/common/Text"; | ||
|
|
||
| export interface MoversErrorPanelProps { | ||
| title: string; | ||
| description: string; | ||
| actionLabel: string; | ||
| isRetrying: boolean; | ||
| onRetry: () => void; | ||
| } | ||
|
|
||
| /** 기사님 찾기 / 상세 공통 네트워크·조회 실패 패널 */ | ||
| export default function MoversErrorPanel({ | ||
| title, | ||
| description, | ||
| actionLabel, | ||
| isRetrying, | ||
| onRetry, | ||
| }: MoversErrorPanelProps) { | ||
| return ( | ||
| <div role="alert" className="flex w-full flex-col items-center gap-16 py-40 text-center"> | ||
| <div className="flex flex-col gap-8"> | ||
| <Text as="p" variant="lg-semibold" className="text-text-secondary"> | ||
| {title} | ||
| </Text> | ||
| <Text as="p" variant="md-regular" className="text-text-muted"> | ||
| {description} | ||
| </Text> | ||
| </div> | ||
| <Button | ||
| type="button" | ||
| variant="outline" | ||
| size="cta" | ||
| disabled={isRetrying} | ||
| onClick={onRetry} | ||
| className="min-w-[160px]" | ||
| > | ||
| {isRetrying ? "다시 시도 중..." : actionLabel} | ||
| </Button> | ||
| </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
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 EmptyState from "@/components/common/EmptyState/EmptyState"; | ||
|
|
||
| /** 잘못된 URL / 존재하지 않는 기사 공통 안내 UI */ | ||
| export default function MoverDetailNotFoundStatus() { | ||
| return ( | ||
| <div className="bg-background-default flex w-full flex-1 flex-col items-center justify-center"> | ||
| <EmptyState | ||
| size="sm" | ||
| imageSrc="/images/empty/character.png" | ||
| description={ | ||
| <> | ||
| 기사님을 찾을 수 없습니다. | ||
| <br /> | ||
| 주소가 잘못되었거나, 존재하지 않는 기사님입니다. | ||
| </> | ||
| } | ||
| buttonLabel="기사님 찾기로 돌아가기" | ||
| href="/movers" | ||
| /> | ||
| </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.