Skip to content

Commit

Permalink
fix: 드롭다운 컴포넌트 변경 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
gs0428 committed Feb 15, 2024
1 parent 42f659f commit c74c607
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/category/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React, { useState } from 'react';
import { useRecoilValue } from 'recoil';
import { IVideoProps } from 'types/videos';

import { CategorySelectBox } from '@/components/SummaryPage/SummaryDetailBox/CategorySelectBox';

import { categoryState } from '@/stores/category';

import * as CardStyles from '@/styles/category/Card.style';
import Chip from '../common/chip/Chip';

Expand All @@ -27,10 +30,8 @@ const Card: React.FC<ICardProps> = ({
category.length ? category[0].categoryId : -1,
);

const onFileClickWithProps = (e: React.MouseEvent) =>
onFileClick && onFileClick(e, video.video_id, selectedCategoryId);

const handleSelectCategory = (categoryId: number) => {
const onFileClickWithProps = (categoryId: number) => {
setSelectedCategoryId(categoryId);
onFileClick && onFileClick(video.video_id, categoryId);
};

Expand Down Expand Up @@ -70,8 +71,8 @@ const Card: React.FC<ICardProps> = ({
{mode === 'recommend' && (
<CardStyles.DropdownWrap>
<CategorySelectBox
selectedCategoryId={video.category_id}
onSelect={handleSelectCategory}
selectedCategoryId={selectedCategoryId}
onSelect={onFileClickWithProps}
/>
</CardStyles.DropdownWrap>
)}
Expand Down

0 comments on commit c74c607

Please sign in to comment.