Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
89 changes: 61 additions & 28 deletions src/components/estimate/detail/EstimateDetailActions.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Button from "@/components/common/Button/Button";
import { Text } from "@/components/common/Text";
import { ConfirmedCheckIcon } from "@/icons";
import { TrashIcon } from "@/icons";
import { cn } from "@/lib/utils/cn";
import { formatPrice } from "@/lib/utils/estimateFormat";

interface EstimateDetailActionsProps {
Expand All @@ -13,12 +14,18 @@ interface EstimateDetailActionsProps {
price?: number;
/** received: sm / pending: detail */
buttonSize?: "sm" | "detail";
/** 요청 상태가 PENDING|OPEN일 때만 취소 아이콘 노출 */
// 2026.08.03 정슬기 - [추가]
canCancelRequest?: boolean;
isCanceling?: boolean;
onCancelRequest?: () => void;
}

/**
* 견적 상세 확정 CTA (받았던·대기 상세 공통)
* // 2026.07.24 정슬기 - [추가]
* // 2026.07.30 정슬기 - [수정] PendingEstimateDetailActions 통합 (optional price·buttonSize)
* // 2026.08.03 정슬기 - [수정] 확정 Primary + 우측 Trash 아이콘 버튼
*/
export default function EstimateDetailActions({
isConfirmed,
Expand All @@ -28,10 +35,16 @@ export default function EstimateDetailActions({
onConfirm,
price,
buttonSize = "sm",
canCancelRequest = false,
isCanceling = false,
onCancelRequest,
}: EstimateDetailActionsProps) {
const showPrice = typeof price === "number";
const showCancel = canCancelRequest && typeof onCancelRequest === "function";

const priceBlock = showPrice ? (
// Desktop(aside)에서만 CTA 위 견적가 표시 — Mobile/Tablet은 본문 EstimateDetailPrice와 중복
// 2026.08.03 정슬기 - [수정]
<div className="flex w-full flex-col gap-0">
<Text as="p" variant="2lg-semibold" className="text-text-weak">
견적가
Expand All @@ -43,42 +56,62 @@ export default function EstimateDetailActions({
) : null;

if (isConfirmed) {
return (
<div className="flex w-full flex-col gap-16">
{priceBlock}
<div className="flex items-center justify-center gap-6">
<ConfirmedCheckIcon className="text-icon-brand size-24 shrink-0" aria-hidden="true" />
<Text as="p" variant="2lg-semibold" className="text-text-brand">
견적이 확정되었습니다
</Text>
</div>
</div>
);
// 확정 안내 문구는 DriverSummary의 "확정견적" 배지로 통일 — 중복 텍스트 제거
// 2026.08.03 정슬기 - [수정] "견적이 확정되었습니다" 제거 (대기 상세는 견적가만 유지)
// Desktop에서만 aside 견적가 노출
if (!showPrice) {
return null;
}

return <div className="hidden w-full flex-col gap-16 lg:flex">{priceBlock}</div>;
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

const disabled = !canConfirm || isConfirming;
const confirmDisabled = !canConfirm || isConfirming || isCanceling;
const reason =
confirmDisabledReason ??
(!canConfirm ? "이미 확정된 견적이 있어 추가로 확정할 수 없습니다." : null);

return (
<div className={showPrice ? "flex w-full flex-col gap-30" : "flex w-full flex-col gap-12"}>
{priceBlock}
<div className={cn("flex w-full flex-col", showPrice ? "gap-12 lg:gap-30" : "gap-12")}>
{showPrice ? <div className="hidden w-full lg:block">{priceBlock}</div> : null}

<div className="flex w-full flex-col gap-12">
<Button
type="button"
variant="solid"
size={buttonSize}
fullWidth
disabled={disabled}
onClick={onConfirm}
className="max-w-full min-w-0"
aria-busy={isConfirming}
>
{isConfirming ? "확정 중..." : "견적 확정하기"}
</Button>
{disabled && reason ? (
{/* [Trash] [견적 확정하기] — Trash size-57 통일, 세로 가운데 정렬 */}
{/* 2026.08.03 정슬기 - [수정] 버튼 순서 교체 · Trash 크기 통일 */}
<div className="flex w-full flex-row items-center gap-8 md:gap-12">
{showCancel ? (
<button
type="button"
aria-label="견적 요청 취소"
aria-busy={isCanceling}
disabled={isCanceling || isConfirming}
onClick={onCancelRequest}
className={cn(
"border-border-default text-text-primary bg-background-surface rounded-16 size-57 shrink-0 border",
"hover:bg-background-hover",
"focus-visible:ring-border-brand focus-visible:ring-2 focus-visible:outline-none",
"disabled:cursor-not-allowed disabled:opacity-40",
"flex items-center justify-center",
)}
>
<TrashIcon className="size-24" aria-hidden="true" />
</button>
) : null}

<Button
type="button"
variant="solid"
size={buttonSize}
fullWidth
disabled={confirmDisabled}
onClick={onConfirm}
className={cn("min-w-0 whitespace-nowrap", showCancel ? "flex-1" : "max-w-full")}
aria-busy={isConfirming}
>
{isConfirming ? "확정 중..." : "견적 확정하기"}
</Button>
</div>
{confirmDisabled && reason && !isConfirming && !isCanceling ? (
<Text as="p" variant="md-regular" className="text-text-muted text-center">
{reason}
</Text>
Expand Down
42 changes: 42 additions & 0 deletions src/components/estimate/detail/EstimateDetailComment.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Text } from "@/components/common/Text";

interface EstimateDetailCommentProps {
comment: string;
}

/**
* 견적 상세 — 기사님 코멘트 (상세 정보 블록 최하단)
* SentEstimateComment와 동일 spacing/타이포 (gap-20 md:gap-28)
* // 2026.08.03 정슬기 - [추가] 받았던/대기 견적 상세용
*/
export default function EstimateDetailComment({ comment }: EstimateDetailCommentProps) {
const trimmed = comment.trim();

if (!trimmed) {
return null;
}

return (
<section
className="flex w-full flex-col gap-20 md:gap-28"
aria-labelledby="estimate-detail-mover-comment-title"
>
<h2 id="estimate-detail-mover-comment-title" className="text-text-primary">
<Text as="span" variant="lg-semibold" className="md:hidden">
기사님 코멘트
</Text>
<Text as="span" variant="xl-semibold" className="hidden md:inline">
기사님 코멘트
</Text>
</h2>

<Text
as="p"
variant="lg-medium"
className="text-text-muted wrap-break-word whitespace-pre-wrap"
>
{trimmed}
</Text>
</section>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export default function EstimateDetailDriverSummary({
)}
</div>

{/* md+: 소개 왼쪽 + 상태(확정견적/견적대기) 오른쪽 — 본문 컬럼 안에서 자연스럽게 정렬 */}
{/* 2026.08.03 정슬기 - [수정] 확정 안내 문구 제거 후 배지만 유지, 과도한 중앙 강제 정렬 제거 */}
<div className="flex w-full items-center justify-between gap-12">
<Text
as="p"
Expand All @@ -67,7 +69,6 @@ export default function EstimateDetailDriverSummary({
>
{intro}
</Text>

<div className="hidden shrink-0 md:block">
{isConfirmed ? (
<ConfirmedStatus />
Expand Down
15 changes: 12 additions & 3 deletions src/components/estimate/detail/EstimateDetailHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
import type { ReactNode } from "react";

import { Text } from "@/components/common/Text";

interface EstimateDetailHeaderProps {
title?: string;
/** Header 우측 액션 슬롯 (보낸 요청 취소 등). 다른 상세에는 영향 없음 */
// 2026.08.03 정슬기 - [추가] optional actions
actions?: ReactNode;
}

export default function EstimateDetailHeader({ title = "견적 상세" }: EstimateDetailHeaderProps) {
export default function EstimateDetailHeader({
title = "견적 상세",
actions,
}: EstimateDetailHeaderProps) {
Comment thread
juengseulki marked this conversation as resolved.
Resolved
return (
// 2026.07.24 정슬기 - [수정] Figma Mobile/Tablet 페이지 헤더 높이·여백, Desktop(lg) 기존 유지
// 2026.07.24 정슬기 - [수정] page-header height/padding·container를 디자인 토큰 유틸로 교체
<header className="bg-background-default px-margin-mobile md:px-margin-tablet h-page-header-height-mobile md:h-page-header-height-tablet lg:h-page-header-height-desktop lg:px-page-header-padding-x-desktop flex w-full items-center justify-center shadow-[0_2px_10px_0_rgba(248,248,248,0.1)]">
<div className="max-w-container-desktop flex w-full flex-1 items-center">
<div className="max-w-container-desktop flex w-full flex-1 items-center justify-between gap-12">
{/* 2026.07.24 정슬기 - [수정] 반응형 타이포를 Text variant로 분리 (단일 h1 유지) */}
<h1 className="text-text-primary">
<h1 className="text-text-primary min-w-0">
<Text as="span" variant="2lg-semibold" className="lg:hidden">
{title}
</Text>
<Text as="span" variant="2xl-semibold" className="hidden lg:inline">
{title}
</Text>
</h1>
{actions ? <div className="flex shrink-0 items-center">{actions}</div> : null}
</div>
</header>
);
Expand Down
22 changes: 16 additions & 6 deletions src/components/estimate/detail/EstimateDetailLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ import EstimatesQueryStatus from "@/components/estimate/EstimatesQueryStatus";
import { cn } from "@/lib/utils/cn";

/**
* 받은 견적·견적요청 상세 공통 레이아웃 프리셋 (tokens: pb-37-5 / w-185 / w-xs)
* 받은 견적·견적요청 상세 공통 레이아웃 프리셋 (tokens: pb-37-5 / w-220 / w-xs)
* // 2026.07.30 정슬기 - [추가] 호출부 임의 px·클래스 중복 제거
*/
export const ESTIMATE_DETAIL_LAYOUT_CLASSES = {
contentClassName: "pt-24 pb-64 md:pt-28 md:pb-80 lg:pb-37-5",
rowClassName: "gap-32 md:gap-40",
mainClassName: "gap-24 md:gap-30 lg:w-185",
asideClassName: "gap-28 md:gap-40 lg:w-xs lg:overflow-clip",
// 본문+aside 블록을 컨테이너 안에서 가운데로 모아 좌측 치우침을 줄인다
// 2026.08.03 정슬기 - [수정] justify-between → justify-center
rowClassName: "gap-32 md:gap-40 lg:justify-center lg:gap-40",
// Desktop 본문만 840→880 — 모바일/태블릿은 w-full 유지
// 2026.08.03 정슬기 - [수정] lg:w-210 → lg:w-220
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
mainClassName: "gap-24 md:gap-30 lg:w-220 lg:shrink-0",
asideClassName: "gap-28 md:gap-40 lg:w-xs lg:shrink-0 lg:overflow-clip",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
} as const;

interface EstimateDetailLayoutProps {
Expand All @@ -22,6 +26,9 @@ interface EstimateDetailLayoutProps {
heroName?: string;
/** 히어로에 프로필 이미지 표시 여부 (요청 상세는 false) */
showProfile?: boolean;
/** Header 우측 액션 (optional — 다른 상세 화면 무영향) */
// 2026.08.03 정슬기 - [추가]
headerActions?: ReactNode;
main: ReactNode;
aside?: ReactNode;
/** main+aside 바깥 여백·폭. Figma 화면별로 다를 수 있음 */
Expand All @@ -45,6 +52,7 @@ export default function EstimateDetailLayout({
heroImageUrl = null,
heroName = "",
showProfile = true,
headerActions,
main,
aside,
contentClassName,
Expand All @@ -55,7 +63,7 @@ export default function EstimateDetailLayout({
}: EstimateDetailLayoutProps) {
return (
<div className="bg-background-default flex w-full max-w-full flex-col items-start overflow-x-hidden">
<EstimateDetailHeader title={title} />
<EstimateDetailHeader title={title} actions={headerActions} />
<DetailHeroBanner imageUrl={heroImageUrl} name={heroName} showProfile={showProfile} />

<div
Expand All @@ -66,7 +74,9 @@ export default function EstimateDetailLayout({
>
<div
className={cn(
"max-w-container-desktop flex w-full flex-col items-stretch lg:flex-row lg:items-start lg:justify-between",
// 기본은 컨테이너 안 가운데 정렬 — 호출부에서 justify-* 로 덮어쓸 수 있음
// 2026.08.03 정슬기 - [수정]
"max-w-container-desktop flex w-full flex-col items-stretch lg:flex-row lg:items-start lg:justify-center",
rowClassName,
)}
>
Expand Down
Loading