From 383e4f6d85be1fc9efa89677cb2244ff8ab53df4 Mon Sep 17 00:00:00 2001 From: gain <163835628+leegain1@users.noreply.github.com> Date: Mon, 16 Nov 2026 17:24:28 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=ED=99=88=20=EB=8C=80=EC=97=AC=20?= =?UTF-8?q?=ED=98=84=ED=99=A9=EC=97=90=20=EC=8A=B9=EC=9D=B8=EB=8C=80?= =?UTF-8?q?=EA=B8=B0=C2=B7=EC=88=98=EB=A0=B9=EB=8C=80=EA=B8=B0=20=EB=AC=BC?= =?UTF-8?q?=ED=92=88=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/components/HomeRentalSection.tsx | 57 ++++++++++++++++--- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/src/features/home/components/HomeRentalSection.tsx b/src/features/home/components/HomeRentalSection.tsx index cbfae37f..94caa65e 100644 --- a/src/features/home/components/HomeRentalSection.tsx +++ b/src/features/home/components/HomeRentalSection.tsx @@ -1,4 +1,4 @@ -import { useSuspenseQuery } from "@tanstack/react-query"; +import { useSuspenseQueries } from "@tanstack/react-query"; import { Button, Divider, Typography } from "@wanteddev/wds"; import returnItemsEmpty from "@/assets/icons/billilge-empty/return-items.svg"; @@ -9,10 +9,19 @@ import { getReturnDueLabel, } from "@/features/billilge/constants/billilge"; import HomeEmptyState from "@/features/home/components/HomeEmptyState"; +import { formatDateTime } from "@/lib/date"; import { billilgeQueries } from "@/shared/entities/billilge/billilgeQueries"; +import type { BillilgeHistoryListResponse } from "@/shared/entities/billilge/billilgeTypes"; const VISIBLE_COUNT = 2; +// 신청했지만 아직 받아 가지 않은 대여(대여 승인대기·수령대기) — 반납 필요 조회에는 없어서 대여 내역에서 고른다 +function selectAwaitingPickup({ histories }: BillilgeHistoryListResponse) { + return histories.filter( + (history) => history.status === "PENDING" || history.status === "CONFIRMED", + ); +} + interface HomeRentalSectionProps { // 반납 신청 — 홈에서 바로 확인 모달을 띄운다 onReturnRequest: (rentalHistoryId: number) => void; @@ -25,16 +34,29 @@ interface HomeRentalSectionProps { // Figma: Rental Summary 2건 (nodeId 3147:146269), 3건 이상 (3147:146326), empty (3562:163925) // 빌릴게 반납 탭과 같은 반납 필요 대여를 받아 그린다(홈 API는 반납 대기·확인을 나누지 않아 쓰지 않는다). 받는 동안은 HomeScreen의 // Suspense가 HomeRentalSkeleton을 보여준다. +// 반납 필요 대여 뒤에 아직 받아 가지 않은 대여도 붙인다 — Figma에 이 상태가 없어서, 반납 기한 대신 대여 예정 시각을 +// 보조 문구로 쓰고 버튼 대신 상태 뱃지를 둔다. 반납 기한이 있는 대여가 더 급해서 먼저 보인다. function HomeRentalSection({ onReturnRequest, onMore, onBrowse, }: HomeRentalSectionProps) { - const { - data: { rentalHistories: rentals }, - } = useSuspenseQuery(billilgeQueries.returnRequired()); + // 두 조회를 따로 기다리지 않게(요청이 줄줄이 이어지지 않게) 한 번에 같이 받는다 — 빌릴게 반납 탭과 같은 조회라 캐시도 같이 쓴다 + const [ + { + data: { rentalHistories: rentals }, + }, + { data: awaitingPickup }, + ] = useSuspenseQueries({ + queries: [ + billilgeQueries.returnRequired(), + { ...billilgeQueries.histories(), select: selectAwaitingPickup }, + ], + }); - if (rentals.length === 0) { + const totalCount = rentals.length + awaitingPickup.length; + + if (totalCount === 0) { return ( @@ -63,10 +90,10 @@ function HomeRentalSection({ variant="label2" weight="medium" > - 대여 중인 물품 · {rentals.length}건 + 대여 중인 물품 · {totalCount}건
- {rentals.slice(0, VISIBLE_COUNT).map((rental) => { + {visibleRentals.map((rental) => { const due = getReturnDueLabel(rental.dueAt); return ( ); })} + {visibleAwaitingPickup.map((rental) => ( + } + /> + ))}
{hiddenCount > 0 && ( <> From e72a15524bc459fbd7d734ab62d679b1bf3d132a Mon Sep 17 00:00:00 2001 From: gain <163835628+leegain1@users.noreply.github.com> Date: Mon, 16 Nov 2026 17:24:28 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=EB=8C=80=EC=97=AC=C2=B7=EB=B0=98?= =?UTF-8?q?=EB=82=A9=20=EC=8A=B9=EC=9D=B8=EB=8C=80=EA=B8=B0=20=EB=B1=83?= =?UTF-8?q?=EC=A7=80=EB=A5=BC=20=EC=A3=BC=ED=99=A9=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/BillilgeStatusBadge.tsx | 9 ++++----- src/features/billilge/constants/billilge.ts | 19 ++++++------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/features/billilge/components/BillilgeStatusBadge.tsx b/src/features/billilge/components/BillilgeStatusBadge.tsx index 9527c4de..40d23a2f 100644 --- a/src/features/billilge/components/BillilgeStatusBadge.tsx +++ b/src/features/billilge/components/BillilgeStatusBadge.tsx @@ -8,16 +8,15 @@ interface BillilgeStatusBadgeProps { } // Figma: 빌릴게 대여내역 뱃지(1133:50036)의 Content Badge/Content Badge. WDS ContentBadge가 color="accent"면 -// accentColor의 8% 배경에 원색 글자를, neutral이면 Fill/Normal 배경을 깔아서 Figma 구조와 같다 -// (EventsStatusBadge와 같은 방식). 크기는 대여 내역 카드(1243:74983)에서 실측한 small이다. +// accentColor의 8% 배경에 원색 글자를 깔아서 Figma 구조와 같다(EventsStatusBadge와 같은 방식). +// 승인대기도 주황으로 바꿔서 모든 상태가 accent다. 크기는 대여 내역 카드(1243:74983)에서 실측한 small이다. function BillilgeStatusBadge({ status }: BillilgeStatusBadgeProps) { const badge = BILLILGE_STATUS_BADGES[status]; return ( diff --git a/src/features/billilge/constants/billilge.ts b/src/features/billilge/constants/billilge.ts index db8369bc..b90e3581 100644 --- a/src/features/billilge/constants/billilge.ts +++ b/src/features/billilge/constants/billilge.ts @@ -28,52 +28,45 @@ export const BILLILGE_CATEGORY_LABELS = { HYGIENE: "위생용품", } satisfies Record; -// 대여 상태 뱃지 — Figma 빌릴게 대여내역 뱃지(1133:50036). 승인을 기다리는 두 상태만 회색(neutral)이고 -// 나머지는 accent 색이다. 대여 내역·반납이 필요한 물품·홈 대여 현황이 같이 쓴다. +// 대여 상태 뱃지 — Figma 빌릴게 대여내역 뱃지(1133:50036). 대여 내역·반납이 필요한 물품·홈 대여 현황이 같이 쓴다. +// Figma는 승인을 기다리는 두 상태(대여·반납 승인대기)가 회색인데, 반려로 오해할 수 있어서 홈 학생회비 "납부확인중" +// 뱃지(3147:146354)와 같은 주황으로 바꿨다. 그래서 모든 상태가 accent 색이라 색 종류(neutral/accent)는 두지 않는다. export const BILLILGE_STATUS_BADGES = { PENDING: { - color: "neutral", label: "대여 승인대기", - token: "semantic.label.alternative", + token: "semantic.accent.foreground.orange", }, CONFIRMED: { - color: "accent", label: "수령대기", token: "semantic.accent.foreground.orange", }, RENTAL: { - color: "accent", label: "대여중", token: "semantic.accent.foreground.blue", }, RETURN_PENDING: { - color: "neutral", label: "반납 승인대기", - token: "semantic.label.alternative", + token: "semantic.accent.foreground.orange", }, RETURN_CONFIRMED: { - color: "accent", label: "반납대기", token: "semantic.accent.foreground.orange", }, RETURNED: { - color: "accent", label: "반납완료", token: "semantic.accent.foreground.green", }, CANCEL: { - color: "accent", label: "대기취소", token: "semantic.accent.foreground.red", }, REJECTED: { - color: "accent", label: "대여불가", token: "semantic.accent.foreground.red", }, } as const satisfies Record< BillilgeRentalStatus, - { color: "neutral" | "accent"; label: string; token: string } + { label: string; token: string } >; // 반납 기한 문구 — 빌릴게 반납 탭과 홈 대여 현황이 같이 쓴다. Figma는 "반납까지 N시간"만 있는데, 며칠짜리 대여는 From e97a1432e7045f1e8960ced9780a6da9c0756ea3 Mon Sep 17 00:00:00 2001 From: gain <163835628+leegain1@users.noreply.github.com> Date: Mon, 16 Nov 2026 17:24:28 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=ED=99=88=20=EC=84=B9=EC=85=98?= =?UTF-8?q?=EC=9D=84=20=EB=8C=80=EC=97=AC=20=ED=98=84=ED=99=A9=C2=B7?= =?UTF-8?q?=EC=8B=A0=EC=B2=AD=20=EC=95=88=EB=82=B4=C2=B7=EC=8B=A0=EC=B2=AD?= =?UTF-8?q?=ED=95=9C=20=ED=96=89=EC=82=AC=20=EC=88=9C=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/home/HomeScreen.tsx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/features/home/HomeScreen.tsx b/src/features/home/HomeScreen.tsx index 3ab12448..90e7f5ca 100644 --- a/src/features/home/HomeScreen.tsx +++ b/src/features/home/HomeScreen.tsx @@ -132,7 +132,18 @@ function HomeScreen() { {/* 배너 카드(relative)가 뒤 섹션보다 나중에 그려져 그림자가 덮지 않게 뒤 섹션도 relative로 둔다 */} + {/* 대여 중인 물품 → 신청 안내(신청마감 D-nn) → 신청한 행사 순으로, 내 대여·신청 현황을 먼저 보여 준다 */}
+
+ {/* 대여 현황은 반납 대기·확인을 나눠 보여 주려고 홈 조회가 아니라 빌릴게 반납 조회·대여 내역 조회로 받는다 */} + }> + navigate(BILLILGE_TAB_PATHS.rent)} + onMore={() => navigate(BILLILGE_TAB_PATHS.return)} + onReturnRequest={openReturnRequest} + /> + +
@@ -145,16 +156,6 @@ function HomeScreen() { onSelect={(section) => push(getApplySectionPath(section))} /> -
- {/* 대여 현황은 반납 대기·확인을 나눠 보여 주려고 홈 조회가 아니라 빌릴게 반납 조회로 받는다 */} - }> - navigate(BILLILGE_TAB_PATHS.rent)} - onMore={() => navigate(BILLILGE_TAB_PATHS.return)} - onReturnRequest={openReturnRequest} - /> - -
}>