diff --git a/src/components/common/Modal/BrandCardModal.tsx b/src/components/common/Modal/BrandCardModal.tsx index 66e88ba..7cb3e75 100644 --- a/src/components/common/Modal/BrandCardModal.tsx +++ b/src/components/common/Modal/BrandCardModal.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import styled from 'styled-components'; @@ -23,6 +23,17 @@ export const BrandCardModal = ({ isOpen, onClose, onAdd }: ModalProps) => { const [description, setDescription] = useState(''); const [status, setStatus] = useState<'준비' | '진행중' | '완료'>('준비'); + useEffect(() => { + if (isOpen) { + setTitle(''); + setType(''); + setStartDate('2024.05.15'); + setDate(''); + setDescription(''); + setStatus('준비'); + } + }, [isOpen]); + const handleAdd = () => { onAdd(title, description, date, status); onClose(); @@ -204,4 +215,4 @@ const Label = styled.div` color: ${({ theme }) => `${theme.color.gray700}`}; ${({ theme }) => theme.font.desktop.body1m}; word-wrap: break-word; -`; +`; \ No newline at end of file