From 0669883481da5e8d621bd27627ebb6f0f3936f1e Mon Sep 17 00:00:00 2001 From: Mungjin01 Date: Thu, 23 May 2024 21:20:25 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=AA=A8=EB=8B=AC=EC=B0=BD=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20(#52)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Modal/BrandCardModal.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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