Skip to content

Commit

Permalink
style: 검색 결과 리스트 컴포넌트 이름 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Leejin-Yang committed Aug 14, 2023
1 parent 001b266 commit e39afcc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { PATH } from '@/constants/path';
import { useIntersectionObserver } from '@/hooks/common';
import { useInfiniteProductSearchResultsQuery } from '@/hooks/queries/search';

interface SearchedListProps {
interface SearchResultListProps {
searchQuery: string;
}

const SearchedList = ({ searchQuery }: SearchedListProps) => {
const SearchResultList = ({ searchQuery }: SearchResultListProps) => {
const { data: searchResponse, fetchNextPage, hasNextPage } = useInfiniteProductSearchResultsQuery(searchQuery);
const scrollRef = useRef<HTMLDivElement>(null);
useIntersectionObserver<HTMLDivElement>(fetchNextPage, scrollRef, hasNextPage);
Expand All @@ -29,23 +29,23 @@ const SearchedList = ({ searchQuery }: SearchedListProps) => {

return (
<>
<SearchedListContainer>
<SearchResultListContainer>
{products.map((product) => (
<li key={product.id}>
<Link as={RouterLink} to={`${PATH.PRODUCT_LIST}/${product.categoryType}/${product.id}`}>
<ProductItem product={product} />
</Link>
</li>
))}
</SearchedListContainer>
</SearchResultListContainer>
<div ref={scrollRef} aria-hidden />
</>
);
};

export default SearchedList;
export default SearchResultList;

const SearchedListContainer = styled.ul`
const SearchResultListContainer = styled.ul`
display: flex;
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Search/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as SearchedList } from './SearchedList/SearchedList';
export { default as SearchResultList } from './SearchResultList/SearchResultList';
export { default as RecommendList } from './RecommendList/RecommendList';
4 changes: 2 additions & 2 deletions frontend/src/pages/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Suspense, useState } from 'react';
import styled from 'styled-components';

import { ErrorBoundary, ErrorComponent, Input, Loading, SvgIcon, TabMenu } from '@/components/Common';
import { RecommendList, SearchedList } from '@/components/Search';
import { RecommendList, SearchResultList } from '@/components/Search';
import { useDebounce } from '@/hooks/common';
import { useSearch } from '@/hooks/search';

Expand Down Expand Up @@ -55,7 +55,7 @@ const SearchPage = () => {
<Mark>&apos;{searchQuery}&apos;</Mark>에 대한 검색결과입니다.
</Heading>
<Spacing size={20} />
<SearchedList searchQuery={debouncedSearchQuery} />
<SearchResultList searchQuery={debouncedSearchQuery} />
</Suspense>
</ErrorBoundary>
) : (
Expand Down

0 comments on commit e39afcc

Please sign in to comment.