Skip to content

Commit

Permalink
Merge pull request #120 from boostcampwm-2022/fix/buttonEvent
Browse files Browse the repository at this point in the history
[Fix] DocListItem 컴포넌트 내부 아이콘 이벤트 핸들러 수정
  • Loading branch information
iyu88 authored Feb 17, 2023
2 parents 35caab4 + 0a85770 commit 5e7e715
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frontend/src/components/docListItem/DocListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React from 'react';
import styled, { useTheme } from 'styled-components';
import { Link } from 'react-router-dom';
// import { COLOR_ACTIVE, COLOR_CAUTION } from '../../constants/styled';
import { ReactComponent as TrashIcon } from '../../assets/trash.svg';
import { ReactComponent as BookmarkIcon } from '../../assets/bookmark.svg';
import { IconButton } from '../iconButton';
import { Modal } from '../modal';
import { ModalForm } from '../modalForm';
import useModal from '../../hooks/useModal';


interface DocListItemProps extends DocListItem {
bookmarkMutate: MutateProp,
unbookmarkMutate: MutateProp,
Expand Down Expand Up @@ -40,8 +38,8 @@ const DocListItem = (props: DocListItemProps) => {

const handleDocumentAction = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
const target = e.target as HTMLButtonElement;
const modalType = target.dataset['value'];
const target = e.currentTarget.closest('button');
const modalType = target?.dataset['value'];
if (!modalType) {
return;
}
Expand Down

0 comments on commit 5e7e715

Please sign in to comment.