Skip to content

Commit 56baab2

Browse files
committed
fix: auctiion history 결과 카드 ui 에러 해결
1 parent 002a14f commit 56baab2

3 files changed

Lines changed: 31 additions & 17 deletions

File tree

src/components/navigation/ThreeTierNav.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ export default function ThreeTierNav() {
254254
return "아이템 이름을 검색하세요";
255255
}, [pathname]);
256256

257-
// Search input component (reusable for both layouts)
258-
const SearchInput = ({ className = "" }: { className?: string }) => (
257+
// Render search input JSX (not a component to avoid remounting)
258+
const renderSearchInput = (className = "") => (
259259
<div className={clsx("relative", className)}>
260260
<Input
261261
ref={searchInputRef}
@@ -425,7 +425,7 @@ export default function ThreeTierNav() {
425425
</Link>
426426

427427
{/* Search - Flexible center area */}
428-
<SearchInput className="flex-1 max-w-2xl mx-auto" />
428+
{renderSearchInput("flex-1 max-w-2xl mx-auto")}
429429

430430
{/* Right Icons - Fixed width */}
431431
<div className="flex items-center gap-1 flex-shrink-0">
@@ -498,7 +498,7 @@ export default function ThreeTierNav() {
498498
{/* Tier 2: Search Bar */}
499499
<div className="h-12 border-b border-gray-100">
500500
<div className="max-w-7xl mx-auto px-4 h-full flex items-center">
501-
<SearchInput className="w-full" />
501+
{renderSearchInput("w-full")}
502502
</div>
503503
</div>
504504

src/components/page/auction-history/ItemOptionPopover.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export default function ItemOptionPopover({
3737
{itemDisplayName}
3838
</div>
3939

40-
{/* 옵션 그룹 영역 (스크롤 가능) */}
41-
<div className="flex-1 overflow-y-auto max-h-[calc(70vh-120px)] space-y-3 pr-1">
40+
{/* 옵션 그룹 영역 (스크롤 가능, 스크롤바 숨김) */}
41+
<div className="flex-1 overflow-y-auto max-h-[calc(70vh-120px)] space-y-3 pr-1 scrollbar-hide [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]">
4242
{groupedOptions.map((group) => (
4343
<OptionGroup key={group.categoryId} group={group} />
4444
))}
@@ -59,9 +59,9 @@ export default function ItemOptionPopover({
5959
*/
6060
function OptionGroup({ group }: { group: GroupedOption }) {
6161
return (
62-
<div className="relative border border-white/30 rounded-sm pt-4 pb-2 px-2.5">
62+
<div className="relative border border-white/30 rounded-sm pt-5 pb-2 px-2.5 mt-1">
6363
{/* 카테고리 라벨 (테두리에 겹치는 스타일) */}
64-
<span className="absolute -top-2 left-2 px-1.5 bg-[#1a1a1a] text-[#e8a854] text-xs font-semibold">
64+
<span className="absolute -top-2.5 left-2 px-1.5 bg-[#1a1a1a] text-[#e8a854] text-xs font-semibold leading-normal">
6565
{group.categoryLabel}
6666
</span>
6767

@@ -127,6 +127,15 @@ function EnchantItem({ option }: { option: ItemOption }) {
127127
const enchantType = formatEnchantType(option.optionSubType);
128128
const hasDesc = option.optionDesc && option.optionDesc.trim().length > 0;
129129

130+
// optionDesc의 ',' 문자를 개행으로 변환하고 각 줄 앞에 '-' 추가
131+
const formatEnchantDesc = (desc: string): string[] => {
132+
return desc
133+
.split(/[,\n]/)
134+
.map((line) => line.trim())
135+
.filter((line) => line.length > 0)
136+
.map((line) => (line.startsWith("-") ? line : `- ${line}`));
137+
};
138+
130139
return (
131140
<div className="mb-1.5">
132141
{/* 인챈트 헤더 */}
@@ -139,7 +148,7 @@ function EnchantItem({ option }: { option: ItemOption }) {
139148
{/* 인챈트 효과 설명 */}
140149
{hasDesc && (
141150
<div className="ml-3 mt-0.5">
142-
{option.optionDesc?.split("\n").map((line, idx) => (
151+
{formatEnchantDesc(option.optionDesc!).map((line, idx) => (
143152
<EffectLine key={idx} text={line} />
144153
))}
145154
</div>
@@ -219,13 +228,13 @@ function ArtisanOptions({ options }: { options: ItemOption[] }) {
219228
<>
220229
{options.map((option) => (
221230
<div key={option.id} className="mb-1.5 last:mb-0">
222-
<div className="text-xs text-[#ccc]">
223-
{option.optionSubType && (
224-
<span className="text-[#b0b0b0]">{option.optionSubType}</span>
225-
)}
226-
</div>
227-
<div className="text-xs ml-2">
228-
<HighlightedValue value={option.optionValue} />
231+
{option.optionSubType && (
232+
<div className="text-xs text-[#b0b0b0] font-medium">
233+
{option.optionSubType}
234+
</div>
235+
)}
236+
<div className="text-xs text-[#ccc] ml-2">
237+
{option.optionValue}
229238
</div>
230239
{option.optionDesc && (
231240
<div className="ml-3 mt-0.5">

src/lib/itemOptionUtils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ export interface ValueSegment {
9191
value: string;
9292
}
9393

94-
export function parseOptionValue(value: string): ValueSegment[] {
94+
export function parseOptionValue(value: string | null | undefined): ValueSegment[] {
95+
// null/undefined 처리
96+
if (value == null) {
97+
return [{ type: "text", value: "" }];
98+
}
99+
95100
const segments: ValueSegment[] = [];
96101
// 숫자, 퍼센트, 범위(~) 포함 패턴
97102
const regex = /([+-]?\d+(?:\.\d+)?%?(?:\s*~\s*[+-]?\d+(?:\.\d+)?%?)?)/g;

0 commit comments

Comments
 (0)