Skip to content

Commit

Permalink
chore: 모달창 초기화 (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
mungjin01 committed May 23, 2024
1 parent 140dffa commit 0669883
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/common/Modal/BrandCardModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react';
import { useEffect, useState } from 'react';

import styled from 'styled-components';

Expand All @@ -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();
Expand Down Expand Up @@ -204,4 +215,4 @@ const Label = styled.div`
color: ${({ theme }) => `${theme.color.gray700}`};
${({ theme }) => theme.font.desktop.body1m};
word-wrap: break-word;
`;
`;

0 comments on commit 0669883

Please sign in to comment.