feat(pop-card-list): 포장 요약 바 UI + 카드 레이아웃 flex column 개선
포장 입력 완료 시 카드 하단에 포장 내역 요약을 표시하여 디자이너가 포장 계산 결과를 즉시 확인할 수 있도록 한다. - 카드 하단에 포장 요약 바 추가 (emerald 테마, 포장완료 뱃지) - height(고정) -> minHeight(유동)으로 카드 자연 성장 허용 - gridAutoRows를 minmax(높이, auto)로 변경 (그리드 셀도 성장) - 카드 flex flex-col + 본문 flex-1 overflow-hidden 구조 - 오른쪽 버튼 영역 justify-center -> justify-start (위쪽 정렬)
This commit is contained in:
parent
85bf4882a8
commit
7a9a705f19
|
|
@ -730,14 +730,13 @@ export function PopCardListComponent({
|
|||
gap: `${scaled.gap}px`,
|
||||
...(isHorizontalMode
|
||||
? {
|
||||
gridTemplateRows: `repeat(${gridRows}, ${scaled.cardHeight}px)`,
|
||||
gridTemplateRows: `repeat(${gridRows}, minmax(${scaled.cardHeight}px, auto))`,
|
||||
gridAutoFlow: "column",
|
||||
gridAutoColumns: `${scaled.cardWidth}px`,
|
||||
}
|
||||
: {
|
||||
// 세로 모드: 1fr 비율 기반으로 컨테이너 너비 초과 방지
|
||||
gridTemplateColumns: `repeat(${gridColumns}, 1fr)`,
|
||||
gridAutoRows: `${scaled.cardHeight}px`,
|
||||
gridAutoRows: `minmax(${scaled.cardHeight}px, auto)`,
|
||||
}),
|
||||
};
|
||||
|
||||
|
|
@ -1008,9 +1007,10 @@ function Card({
|
|||
}
|
||||
}, [effectiveMax, inputField?.enabled, limitCol, isCartListMode]);
|
||||
|
||||
const hasPackageEntries = packageEntries.length > 0;
|
||||
|
||||
const cardStyle: React.CSSProperties = {
|
||||
height: `${scaled.cardHeight}px`,
|
||||
overflow: "hidden",
|
||||
minHeight: `${scaled.cardHeight}px`,
|
||||
};
|
||||
|
||||
const headerStyle: React.CSSProperties = {
|
||||
|
|
@ -1116,7 +1116,7 @@ function Card({
|
|||
|
||||
return (
|
||||
<div
|
||||
className={`relative cursor-pointer rounded-lg border bg-card shadow-sm transition-all duration-150 hover:shadow-md ${borderClass}`}
|
||||
className={`relative flex cursor-pointer flex-col rounded-lg border bg-card shadow-sm transition-all duration-150 hover:shadow-md ${borderClass}`}
|
||||
style={cardStyle}
|
||||
onClick={handleCardClick}
|
||||
role="button"
|
||||
|
|
@ -1157,7 +1157,7 @@ function Card({
|
|||
)}
|
||||
|
||||
{/* 본문 영역 */}
|
||||
<div className="flex" style={bodyStyle}>
|
||||
<div className="flex flex-1 overflow-hidden" style={bodyStyle}>
|
||||
{/* 이미지 (왼쪽) */}
|
||||
{image?.enabled && (
|
||||
<div className="shrink-0">
|
||||
|
|
@ -1199,7 +1199,7 @@ function Card({
|
|||
{/* 오른쪽: 수량 버튼 + 담기/취소/삭제 버튼 */}
|
||||
{(inputField?.enabled || cartAction || isCartListMode) && (
|
||||
<div
|
||||
className="ml-2 flex shrink-0 flex-col items-stretch justify-center gap-2"
|
||||
className="ml-2 flex shrink-0 flex-col items-stretch justify-start gap-2"
|
||||
style={{ minWidth: "100px" }}
|
||||
>
|
||||
{/* 수량 버튼 (입력 필드 ON일 때만) */}
|
||||
|
|
@ -1268,6 +1268,37 @@ function Card({
|
|||
)}
|
||||
</div>
|
||||
|
||||
{/* 포장 요약 바: 본문 아래에 표시 */}
|
||||
{hasPackageEntries && (
|
||||
<div className="border-t bg-emerald-50">
|
||||
{packageEntries.map((entry, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className="flex items-center justify-between px-3 py-1.5"
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="rounded-full bg-emerald-500 px-2 py-0.5 text-[10px] font-bold text-white">
|
||||
포장완료
|
||||
</span>
|
||||
<Package className="h-4 w-4 text-emerald-600" />
|
||||
<span
|
||||
className="font-medium text-emerald-700"
|
||||
style={{ fontSize: `${scaled.bodyTextSize}px` }}
|
||||
>
|
||||
{entry.packageCount}{entry.unitLabel} x {entry.quantityPerUnit}
|
||||
</span>
|
||||
</div>
|
||||
<span
|
||||
className="font-bold text-emerald-700"
|
||||
style={{ fontSize: `${scaled.bodyTextSize}px` }}
|
||||
>
|
||||
= {entry.totalQuantity.toLocaleString()}{inputField?.unit || "EA"}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{inputField?.enabled && (
|
||||
<NumberInputModal
|
||||
open={isModalOpen}
|
||||
|
|
|
|||
Loading…
Reference in New Issue