[SearchPanel] scrollTop 적용

This commit is contained in:
hyunwoo93.cha
2024-02-20 16:40:56 +09:00
parent 2f2f369013
commit a5451e8a75
2 changed files with 5 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ import { getSearch, resetSearch } from "../../actions/searchActions";
import TBody from "../../components/TBody/TBody";
import TInput, { ICONS, KINDS } from "../../components/TInput/TInput";
import TPanel from "../../components/TPanel/TPanel";
import useScrollTo from "../../hooks/useScrollTo";
import NoSearchResults from "./NoSearchResults/NoSearchResults";
import RecommendedKeywords from "./RecommendedKeywords/RecommendedKeywords";
import css from "./SearchPanel.module.less";
@@ -17,6 +18,7 @@ const ITEMS_PER_PAGE = 9;
export default function SearchPanel() {
const dispatch = useDispatch();
const { getScrollTo, scrollTop } = useScrollTo();
const recommandedKeywords = useSelector(
(state) => state.myPage.recommandedKeywordData.data?.keywords
@@ -107,15 +109,15 @@ export default function SearchPanel() {
return (
<TPanel className={css.container}>
<TBody className={css.tBody}>
<TBody className={css.tBody} cbScrollTo={getScrollTo}>
<TInput
className={css.input}
autoFocus
kind={KINDS.withIcon}
icon={ICONS.search}
value={searchQuery}
onChange={handleSearchChange}
onIconClick={() => handleSearchSubmit(searchQuery)}
scrollTop={scrollTop}
/>
{searchPerformed ? (
Object.keys(searchDatas).length > 0 ? (

View File

@@ -1,3 +1,3 @@
.container {
padding: 94px 60px 0 60px;
margin: 94px 60px 0 60px;
}