[searchPanel] 기획에 맞춰 수정#1

- 기획서에 맞춰서 수정
This commit is contained in:
junghoon86.park
2025-10-22 21:39:43 +09:00
parent c60c97ccfd
commit 4ffacbdef9
3 changed files with 544 additions and 372 deletions

View File

@@ -92,13 +92,17 @@ const SearchInputOverlay = ({
);
useEffect(() => {
const spotTime = setTimeout(() => {
Spotlight.focus("search_input_overlay");
}, 100);
return () => {
clearTimeout(spotTime);
};
}, []);
if (isVisible) {
const input = document.querySelector(
`[data-spotlight-id="input-field-box"] > input`
);
console.log("###input", input);
console.log("###input.value", input.value);
if (input) {
input.focus();
}
}
}, [isVisible]);
return (
<TFullPopup
@@ -114,16 +118,9 @@ const SearchInputOverlay = ({
<div className={css.overlayContainer}>
{/* 배경 dim 레이어 - 클릭하면 닫힘 */}
<div className={css.dimBackground} onClick={handleDimClick} />
<OverlayContainer
className={css.contentArea}
spotlightId={"search_input_overlay"}
spotlightDisabled={!isVisible}
>
<div className={css.contentArea}>
{/* 입력창과 마이크 버튼 - SearchPanel.inputContainer와 동일한 구조 */}
<div
className={css.inputWrapper}
onClick={(e) => e.stopPropagation()}
>
<div className={css.inputWrapper}>
<div className={css.searchInputWrapper}>
<TInput
className={css.inputBox}
@@ -136,6 +133,7 @@ const SearchInputOverlay = ({
handleSearchSubmit(searchQuery);
}}
spotlightId={"search_overlay_input_box"}
spotlightBoxDisabled
/>
</div>
</div>
@@ -153,7 +151,7 @@ const SearchInputOverlay = ({
</SpottableKeyword>
))}
</div>
</OverlayContainer>
</div>
</div>
</TFullPopup>
);

View File

@@ -1,5 +1,6 @@
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState,
@@ -208,32 +209,36 @@ const SearchResultsNew = ({
// relativeQuerys 가져오기 (ShopperHouse API 응답)
const relativeQuerys = useMemo(() => {
if (shopperHouseInfo?.results?.[0]?.relativeQuerys) {
return shopperHouseInfo.results[0].relativeQuerys;
if (shopperHouseInfo?.results?.[0]?.relativeQueries) {
return shopperHouseInfo.results[0].relativeQueries;
}
// 기본값
return ["Puppy food", "Dog toy", "Fitness"];
}, [shopperHouseInfo]);
useEffect(() => {
console.log("###shopperHouseInfo", shopperHouseInfo);
}, [shopperHouseInfo]);
return (
<div className={css.searchBox}>
<div className={css.topBox}>
<span className={css.topBoxTitle}>How about these?</span>
<ul className={css.topBoxList}>
{relativeQuerys.map((text, index) => {
const handleClick = () => keywordClick(text);
return (
<SpottableLi
key={`query-${index}`}
className={css.topBoxListItem}
onClick={handleClick}
>
{text}
</SpottableLi>
);
})}
</ul>
</div>
{relativeQuerys && relativeQuerys?.length > 0 && (
<div className={css.topBox}>
<span className={css.topBoxTitle}>How about these?</span>
<ul className={css.topBoxList}>
{relativeQuerys?.map((text, index) => {
const handleClick = () => keywordClick(text);
return (
<SpottableLi
key={`query-${index}`}
className={css.topBoxListItem}
onClick={handleClick}
>
{text}
</SpottableLi>
);
})}
</ul>
</div>
)}
{themeInfo && themeInfo?.length > 0 && (
<div className={css.hotpicksSection} data-wheel-point="true">
<div className={css.sectionHeader}>
@@ -263,7 +268,7 @@ const SearchResultsNew = ({
listType={LIST_TYPE.medium}
spotlightId={SpotlightIds.SEARCH_TAB_CONTAINER}
/>
{/* 2025/10/17 김영진 부장과 이야기 하여 일반에서는 아직 필터 검토하지않아 빼달라고 하여 우선 일반검색에서는 미노출 처리 추후 처리 필요함 */}
{/* 일반 검색에서는 필터 사용 하지않기로함. 10/21 시연중 문의 */}
{tab === 0 && !itemInfo?.length && (
<TDropDown
className={classNames(