Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f208fe2
feat: 지정 견적 요청 API 클라이언트(designateMover) 추가
yooseohyeon Jul 29, 2026
3a8234b
refactor: 견적 요청 active API를 fetchInstance로 변환
yooseohyeon Jul 29, 2026
08cc7a1
refactor: active 견적 요청을 전용 훅으로 분리 (EstimateRequestForm에서 추출)
yooseohyeon Jul 29, 2026
c42f340
feat: 지정 견적 요청 훅 추가 (useDesignateMover)
yooseohyeon Jul 29, 2026
2b585f3
feat: 공통 Button 컴포넌트의 solid/outline 비활성 스타일 추가
yooseohyeon Jul 29, 2026
55d79c5
feat: 기사님 리뷰 날짜 표시 형식 수정 (YYYY-MM-DD 포맷)
yooseohyeon Jul 29, 2026
98bbca5
feat: 공통 모달(Modal) 컴포넌트 확장
yooseohyeon Jul 29, 2026
e17438f
feat: 기사 상세 페이지 지정 견적 요청 플로우 구현
yooseohyeon Jul 29, 2026
fd65e66
feat: 지정 견적 요청 완료 시 성공 모달 및 내 견적 요청 임시 페이지 추가
yooseohyeon Jul 29, 2026
afb35a8
fix: 안내 모달 설명 문구 모바일에서 넘침 방지 (whitespace-nowrap 제거)
yooseohyeon Jul 29, 2026
a784866
fix: 활성 견적 조회 실패 시 "견적 요청 없음"으로 처리되는 문제 수정
yooseohyeon Jul 29, 2026
41a5297
fix: 기사 상세 페이지에서 DesignateSuccessModal 컴포넌트 누락 수정
yooseohyeon Jul 29, 2026
f4b8146
fix: 지정 견적 요청 성공 모달에서 whitespace-nowrap 제거
yooseohyeon Jul 29, 2026
2e513ed
fix: 내가 보낸 견적 요청 임시 페이지에 metadata 추가
yooseohyeon Jul 29, 2026
018bd97
refactor: 견적 요청 API 함수 fetchInstance로 통일 (createEstimateRequest)
yooseohyeon Jul 29, 2026
bc1948d
fix: 지정 견적 성공 시 대기 중 견적 목록 캐시(PENDING_LIST_ROOT) 무효화
yooseohyeon Jul 30, 2026
f34b542
fix: 활성 견적 조회 실패 시 버튼 재클릭으로 refetch 하도록 수정
yooseohyeon Jul 30, 2026
2d656ea
fix: 견적 요청 생성 성공 시 ACTIVE 캐시 타입 유지
yooseohyeon Jul 30, 2026
8c72fd6
fix: 지정 견적 CTA 버튼에서 요청 가능 여부를 우선하고 요청이 불가능한 경우 UI 변경
yooseohyeon Jul 30, 2026
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
15 changes: 15 additions & 0 deletions src/app/estimates/requests/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Text } from "@/components/common/Text";

/** NOTE: 내가 보낸 견적 요청 페이지. 추후 수정이 필요 */
export default function EstimateRequestsPage() {
return (
<div className="flex min-h-[60vh] w-full flex-col items-center justify-center gap-16">
<Text as="h1" variant="2xl-semibold" className="text-text-primary">
내가 보낸 견적 요청
</Text>
<Text variant="lg-regular" className="text-text-tertiary">
페이지 준비 중입니다.
</Text>
</div>
);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
52 changes: 38 additions & 14 deletions src/components/auth/LoginRequiredModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,33 @@
import { useRouter } from "next/navigation";

import Modal from "@/components/common/Modal/Modal";
import { getTextVariantClass } from "@/components/common/Text";
import { getLoginRedirectPath } from "@/lib/auth/session";

const PANEL_CLASSNAME = [
"items-stretch text-left",
"rounded-24 md:rounded-32",
"w-full max-w-[292px] gap-30 px-16 py-24",
"md:max-w-[608px] md:gap-40 md:px-24 md:pt-32 md:pb-40",
].join(" ");

interface LoginRequiredModalProps {
open: boolean;
onClose: () => void;
/** 호출부에서 맥락에 맞는 안내 문구를 전달. 미지정 시 기본값 사용 */
description?: string;
}

/**
* 비로그인 사용자가 인증 필요 액션(찜 등)을 눌렀을 때 안내
* Figma: modal/general-request-required 계열 레이아웃
*/
export function LoginRequiredModal({ open, onClose }: LoginRequiredModalProps) {
const DEFAULT_DESCRIPTION = "찜하기는 로그인 후 이용할 수 있어요.";

export function LoginRequiredModal({
open,
onClose,
description = DEFAULT_DESCRIPTION,
}: LoginRequiredModalProps) {
const router = useRouter();

const handleLogin = () => {
Expand All @@ -27,18 +42,27 @@ export function LoginRequiredModal({ open, onClose }: LoginRequiredModalProps) {
}

return (
<Modal
onClose={onClose}
className="rounded-24 md:rounded-32 w-full max-w-[292px] gap-30 px-16 py-24 md:max-w-[608px] md:gap-40 md:px-24 md:pt-32 md:pb-40"
>
<Modal.Close onClose={onClose} />
<Modal.Title>로그인이 필요해요</Modal.Title>
<Modal.Desc className={getTextVariantClass("2lg-medium")}>
찜하기는 로그인 후 이용할 수 있어요.
</Modal.Desc>
<Modal.Button fullWidth size="detail" onClick={handleLogin}>
로그인하기
</Modal.Button>
<Modal onClose={onClose} className={PANEL_CLASSNAME}>
<div className="flex w-full items-center justify-between gap-12">
<Modal.Title variant={{ base: "2lg-bold", md: "2xl-semibold" }}>
로그인이 필요해요
</Modal.Title>
<Modal.Close onClose={onClose} />
</div>
<div className="flex w-full flex-col items-stretch gap-30 md:gap-40">
<Modal.Desc variant="2lg-medium">{description}</Modal.Desc>
<Modal.Button fullWidth size="cta" className="md:hidden" onClick={handleLogin}>
로그인하기
</Modal.Button>
<Modal.Button
fullWidth
size="detail"
className="hidden md:inline-flex"
onClick={handleLogin}
>
로그인하기
</Modal.Button>
</div>
</Modal>
);
}
8 changes: 5 additions & 3 deletions src/components/auth/LoginRequiredModalProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createContext, useCallback, useContext, useMemo, useState, type ReactNo
import { LoginRequiredModal } from "@/components/auth/LoginRequiredModal";

interface LoginRequiredModalContextValue {
openLoginRequiredModal: () => void;
openLoginRequiredModal: (description?: string) => void;
}

const LoginRequiredModalContext = createContext<LoginRequiredModalContextValue | null>(null);
Expand All @@ -17,8 +17,10 @@ interface LoginRequiredModalProviderProps {
/** 비회원이 찜 등 인증 액션에 닿을 수 있는 라우트(기사님 찾기)에만 감싼다. */
export function LoginRequiredModalProvider({ children }: LoginRequiredModalProviderProps) {
const [open, setOpen] = useState(false);
const [description, setDescription] = useState<string | undefined>();

const openLoginRequiredModal = useCallback(() => {
const openLoginRequiredModal = useCallback((desc?: string) => {
setDescription(desc);
setOpen(true);
}, []);

Expand All @@ -32,7 +34,7 @@ export function LoginRequiredModalProvider({ children }: LoginRequiredModalProvi
return (
<LoginRequiredModalContext.Provider value={value}>
{children}
<LoginRequiredModal open={open} onClose={() => setOpen(false)} />
<LoginRequiredModal open={open} onClose={() => setOpen(false)} description={description} />
</LoginRequiredModalContext.Provider>
);
}
Expand Down
8 changes: 5 additions & 3 deletions src/components/common/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import { Text } from "@/components/common/Text";
import { cn } from "@/lib/utils/cn";

// 2026.07.25 정슬기 - [수정] size별 height/radius를 분리하고 Figma Button/*/CTA(h54,r12)용 cta 추가
// 2026.07.29 - [수정] solid/outline 비활성 스타일 분리
const buttonVariants = cva(
"inline-flex items-center justify-center gap-4 transition-colors disabled:cursor-not-allowed disabled:bg-background-disabled disabled:text-text-disabled",
"inline-flex items-center justify-center gap-4 transition-colors disabled:cursor-not-allowed",
{
variants: {
variant: {
solid: "bg-background-brand text-text-inverse hover:bg-background-brand-hover",
solid:
"bg-background-brand text-text-inverse hover:bg-background-brand-hover disabled:bg-background-disabled disabled:text-text-inverse disabled:hover:bg-background-disabled",
outline:
"border border-1 border-border-brand bg-background-surface text-text-brand hover:bg-background-brand-muted",
"border border-1 border-border-brand bg-background-surface text-text-brand hover:bg-background-brand-muted disabled:border-border-disabled disabled:text-text-disabled disabled:hover:bg-background-surface",
},
size: {
sm: "h-57 min-w-[300px] rounded-16 p-16",
Expand Down
5 changes: 3 additions & 2 deletions src/components/common/Modal/ModalClose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ interface ModalCloseProps {
disabled?: boolean;
}

/** 제목 row 안에서 사용 (Figma Frame 2610183: title + X, justify-between) */
const ModalClose = ({ onClose, disabled = false }: ModalCloseProps) => {
return (
<button
type="button"
className={cn(
disabled && "cursor-not-allowed opacity-40",
"text-icon-default rounded-8 absolute top-30 right-30 flex size-36 cursor-pointer items-center justify-center transition-colors",
"text-icon-default rounded-8 flex size-24 shrink-0 cursor-pointer items-center justify-center transition-colors md:size-36",
"hover:bg-background-hover hover:text-icon-default",
"active:bg-background-hover",
"focus-visible:ring-border-brand focus-visible:ring-2 focus-visible:outline-none",
Expand All @@ -21,7 +22,7 @@ const ModalClose = ({ onClose, disabled = false }: ModalCloseProps) => {
disabled={disabled}
aria-label="모달 닫기"
>
<CloseIcon className="size-18" />
<CloseIcon className="size-24 md:size-36" />
</button>
);
};
Expand Down
11 changes: 8 additions & 3 deletions src/components/common/Modal/ModalDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@

import { useEffect, type ReactNode } from "react";

import { Text } from "@/components/common/Text";
import { Text, type TextVariantProp } from "@/components/common/Text";
import { cn } from "@/lib/utils/cn";

import { useModalContext } from "./ModalMain";

interface ModalDescriptionProps {
children: ReactNode;
className?: string;
variant?: TextVariantProp;
}

const ModalDescription = ({ children, className }: ModalDescriptionProps) => {
const ModalDescription = ({
children,
className,
variant = "md-regular",
}: ModalDescriptionProps) => {
const { descriptionId, setHasDescription } = useModalContext();

useEffect(() => {
Expand All @@ -24,7 +29,7 @@ const ModalDescription = ({ children, className }: ModalDescriptionProps) => {
<Text
as="p"
id={descriptionId}
variant="md-regular"
variant={variant}
className={cn("text-text-secondary", className)}
>
{children}
Expand Down
18 changes: 15 additions & 3 deletions src/components/common/Modal/ModalTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

import { useEffect, type ReactNode } from "react";

import { Text } from "@/components/common/Text";
import { Text, type TextVariantProp } from "@/components/common/Text";
import { cn } from "@/lib/utils/cn";

import { useModalContext } from "./ModalMain";

const ModalTitle = ({ children }: { children: ReactNode }) => {
interface ModalTitleProps {
children: ReactNode;
className?: string;
variant?: TextVariantProp;
}

const ModalTitle = ({ children, className, variant = "xl-bold" }: ModalTitleProps) => {
const { titleId, setHasTitle } = useModalContext();

useEffect(() => {
Expand All @@ -15,7 +22,12 @@ const ModalTitle = ({ children }: { children: ReactNode }) => {
}, [setHasTitle]);

return (
<Text as="h2" id={titleId} variant="xl-bold" className="text-text-primary">
<Text
as="h2"
id={titleId}
variant={variant}
className={cn("text-text-primary min-w-0", className)}
>
{children}
</Text>
);
Expand Down
58 changes: 58 additions & 0 deletions src/components/estimate/DesignateSuccessModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"use client";

import { useRouter } from "next/navigation";

import Modal from "@/components/common/Modal/Modal";
import { APP_ROUTES } from "@/lib/constants/appRoutes";

const PANEL_CLASSNAME = [
"items-stretch text-left",
"rounded-24 md:rounded-32",
"w-full max-w-[292px] gap-30 px-16 py-24",
"md:max-w-[608px] md:gap-40 md:px-24 md:pt-32 md:pb-40",
].join(" ");

interface DesignateSuccessModalProps {
open: boolean;
onClose: () => void;
}

export default function DesignateSuccessModal({ open, onClose }: DesignateSuccessModalProps) {
const router = useRouter();

const handleGoToEstimates = () => {
onClose();
router.push(APP_ROUTES.ESTIMATES.REQUESTS);
};

if (!open) {
return null;
}

return (
<Modal onClose={onClose} className={PANEL_CLASSNAME}>
<div className="flex w-full items-center justify-between gap-12">
<Modal.Title variant={{ base: "2lg-bold", md: "2xl-semibold" }}>
지정 견적 요청 완료
</Modal.Title>
<Modal.Close onClose={onClose} />
</div>
<div className="flex w-full flex-col items-stretch gap-30 md:gap-40">
<Modal.Desc variant="2lg-medium" className="whitespace-nowrap">
지정 견적 요청이 완료되었습니다.
</Modal.Desc>
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
<Modal.Button fullWidth size="cta" className="md:hidden" onClick={handleGoToEstimates}>
지정 견적서 보러가기
</Modal.Button>
<Modal.Button
fullWidth
size="detail"
className="hidden md:inline-flex"
onClick={handleGoToEstimates}
>
지정 견적서 보러가기
</Modal.Button>
</div>
</Modal>
);
}
9 changes: 3 additions & 6 deletions src/components/estimate/EstimateRequestForm.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"use client";

import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useCallback, useEffect, useState } from "react";

import { Text } from "@/components/common/Text";
import Toast from "@/components/common/Toast";
import { useActiveEstimateRequest } from "@/hooks/useActiveEstimateRequest";
import { login, refreshSession } from "@/lib/api/auth";
import {
buildCreateEstimateRequestPayload,
createEstimateRequest,
getActiveEstimateRequest,
} from "@/lib/api/estimateRequest";
import { getApiError } from "@/lib/api/getApiError";
import { getAccessToken } from "@/lib/auth/token";
Expand Down Expand Up @@ -208,11 +208,8 @@ export default function EstimateRequestForm() {
data: activeRequest,
isLoading: isActiveLoading,
isError: isActiveError,
} = useQuery({
queryKey: QUERY_KEYS.ESTIMATE_REQUESTS.ACTIVE,
queryFn: getActiveEstimateRequest,
} = useActiveEstimateRequest({
enabled: authReady && Boolean(getAccessToken()),
retry: 1,
});

// 2026.07.26 정슬기 - [수정] 생성 성공 시 내 견적 목록 캐시 무효화 (대기 목록이 stale하지 않도록)
Expand Down
67 changes: 67 additions & 0 deletions src/components/estimate/EstimateRequestRequiredModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"use client";

import { useRouter } from "next/navigation";

import Modal from "@/components/common/Modal/Modal";
import { APP_ROUTES } from "@/lib/constants/appRoutes";

const PANEL_CLASSNAME = [
"items-stretch text-left",
"rounded-24 md:rounded-32",
"w-full max-w-[292px] gap-30 px-16 py-24",
"md:max-w-[608px] md:gap-40 md:px-24 md:pt-32 md:pb-40",
].join(" ");

interface EstimateRequestRequiredModalProps {
open: boolean;
onClose: () => void;
}

/**
* 지정 견적 요청 시 진행 중인 일반 견적 요청이 없을 때 안내
*/
export default function EstimateRequestRequiredModal({
open,
onClose,
}: EstimateRequestRequiredModalProps) {
const router = useRouter();

const handleGoToEstimateRequest = () => {
onClose();
router.push(APP_ROUTES.ESTIMATE_REQUEST);
};

if (!open) {
return null;
}

return (
<Modal onClose={onClose} className={PANEL_CLASSNAME}>
<div className="flex w-full items-center justify-between gap-12">
<Modal.Title variant={{ base: "2lg-bold", md: "2xl-semibold" }}>
지정 견적 요청하기
</Modal.Title>
<Modal.Close onClose={onClose} />
</div>
<div className="flex w-full flex-col items-stretch gap-30 md:gap-40">
<Modal.Desc variant="2lg-medium">일반 견적 요청을 먼저 진행해 주세요.</Modal.Desc>
<Modal.Button
fullWidth
size="cta"
className="md:hidden"
onClick={handleGoToEstimateRequest}
>
일반 견적 요청 하기
</Modal.Button>
<Modal.Button
fullWidth
size="detail"
className="hidden md:inline-flex"
onClick={handleGoToEstimateRequest}
>
일반 견적 요청 하기
</Modal.Button>
</div>
</Modal>
);
}
Loading