[SearchPanel] scrollTop 적용
This commit is contained in:
@@ -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 ? (
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
.container {
|
||||
padding: 94px 60px 0 60px;
|
||||
margin: 94px 60px 0 60px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user