Skip to content

Commit

Permalink
Feat: 카드 수정 모달 제출 후 동작 수정
Browse files Browse the repository at this point in the history
카드list를 컬럼list랑 다른 컴포넌트에서 쓰고 있는데 다른 컴포넌트의 카드 리스트를 변경하는 동작이 이 모달이 있어서... 구현이 생각보다 까다롭네요.
현재는 일단 페이지 전체를 새로고침하는걸로 달아놨습니다.
  • Loading branch information
foxholic9 committed Jun 13, 2024
1 parent ae2042b commit 5883df9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ interface CardListProps {
dashboardId: number;
};
setElement: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
afterSubmit: () => void;
}

function CardList({
cardList,
hasNext,
columnData,
setElement,
afterSubmit,
}: CardListProps) {
return (
<div>
Expand All @@ -28,7 +26,6 @@ function CardList({
cardId={cardData.id}
cardData={cardData}
columnData={columnData}
afterSubmit={afterSubmit}
/>
))}
{hasNext && <div ref={setElement} style={{ height: '20px' }} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ function Column({
hasNext={hasNext}
setElement={setElement}
columnData={columnData}
afterSubmit={afterSubmit}
/>
{settingModalOpen ? (
<EditColumnManagement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface CardProps {
columnId: number;
dashboardId: number;
};
afterSubmit: () => void;
}

// 날짜 표시 formating
Expand All @@ -29,7 +28,6 @@ function ColumnCard({
cardId,
cardData,
columnData,
afterSubmit,
}: CardProps) {
const [manageCardModalOpen, setManageCardModalOpen] = useState<boolean>(false);
const {
Expand All @@ -45,6 +43,10 @@ function ColumnCard({
setManageCardModalOpen(true);
};

// 모달 응답
const afterSubmit = () => {
window.location.reload();
};
// 컴포넌트 출력
return (
<div className={styles.wrapper}>
Expand Down

0 comments on commit 5883df9

Please sign in to comment.