Skip to content

Commit

Permalink
feat: add empty view on category search page (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyuhho committed Jul 14, 2024
1 parent def9d31 commit 02462b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AppendCategoryType } from 'utils/AppendCategoryType';
import { consultStyleToCharNum } from 'utils/convertStringToCharNum';
import { Flex } from 'components/Common/Flex';
import CounselorCard from 'components/Common/CounselorCard';
import EmptySection from 'components/Common/EmptySection';
interface CategorySearchResultsProps {
searchData: SearchResultData[];
}
Expand All @@ -11,6 +12,10 @@ interface CategorySearchResultsProps {
export const CategorySearchResults = ({
searchData,
}: CategorySearchResultsProps) => {
if (searchData.length === 0) {
return <EmptySection title="검색 결과가 없어요." />;
}

return (
<Flex direction="column" gap="0.8rem" style={{ padding: '0 2rem' }}>
{searchData.map((value) => {
Expand Down
1 change: 1 addition & 0 deletions src/pages/Buyer/BuyerCategoryResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const BuyerCategoryResult = () => {
preventRef.current = true;
}
};

//현재 대상 및 option을 props로 전달
const { setTarget } = useIntersectionObserver({
root: null,
Expand Down
1 change: 1 addition & 0 deletions src/utils/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export type WishlistDataType = {
ratingAverage: number;
totalReview: number;
};

export interface PaymentInfo {
paymentId: number;
nickname: string;
Expand Down

0 comments on commit 02462b4

Please sign in to comment.