Skip to content

Commit

Permalink
feature-057: 빌드 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
whistleJs committed Feb 13, 2024
1 parent 27ec382 commit 81cd8e2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/components/Home/InsightVideos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const InsightVideos: React.FC<InsightVideosProps> = ({
const [categoryItems] = useState<IVideoProps[]>([]);
const [checkedItems, setCheckedItems] = useState<number[]>([]);

const onFileClick = (e: React.MouseEvent<HTMLSpanElement>) => {
const onFileClick = (e: React.MouseEvent) => {
e.stopPropagation();
// 비디오 카테고리로 저장 API 호출 후 이런 인사이트는 어때요 API 재호출로 최신화하기
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { CategoryDropdown } from './CategoryDropdown';
type Props = {
selectedCategoryId?: number;
onSelect: (categoryId: number) => void;
onFileClick?: () => void;
onFileClick?: (e: React.MouseEvent) => void;
};

const CategorySelectBox = ({
Expand Down
34 changes: 14 additions & 20 deletions src/components/category/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import React, { useState } from 'react';
import * as CardStyles from '@/styles/category/Card.style';
import { IVideoProps } from 'types/videos';
import { CategorySelectBox } from '../SummaryPage/SummaryDetailBox/CategorySelectBox';
import { ISelectedCategoryProps } from 'types/category';
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';

interface ICardProps {
mode: 'default' | 'category' | 'recommend';
video: IVideoProps;
checkedVideos?: number[];
setCheckedVideos?: (value: number[]) => void;
onFileClick?: (e: React.MouseEvent<HTMLSpanElement>) => void;
onFileClick?: (e: React.MouseEvent) => void;
}

const Card: React.FC<ICardProps> = ({
Expand All @@ -23,20 +25,12 @@ const Card: React.FC<ICardProps> = ({
}) => {
const [isOpen, setIsOpen] = useState(false);
const category = useRecoilValue(categoryState);
const [selectedCategory, setSelectedCategory] =
useState<ISelectedCategoryProps>({
name: category[0].name,
categoryId: category[0].categoryId,
});
const [selectedCategoryId, setSelectedCategoryId] = useState(
category[0].categoryId,
);

const handleSelectCategory = ({
name,
categoryId,
}: ISelectedCategoryProps) => {
setSelectedCategory({
name,
categoryId,
});
const handleSelectCategory = (categoryId: number) => {
setSelectedCategoryId(categoryId);
};

const handleCheckBox = (videoId: number) => {
Expand Down Expand Up @@ -77,8 +71,8 @@ const Card: React.FC<ICardProps> = ({
{isOpen && mode === 'recommend' && (
<CardStyles.DropdownWrap>
<CategorySelectBox
selectedCategory={selectedCategory}
handleSelectCategory={handleSelectCategory}
selectedCategoryId={selectedCategoryId}
onSelect={handleSelectCategory}
onFileClick={onFileClick}
/>
</CardStyles.DropdownWrap>
Expand Down

0 comments on commit 81cd8e2

Please sign in to comment.