From 64dd8781bd4692581cec96a1880eb22c81b9935d Mon Sep 17 00:00:00 2001 From: yena Date: Sun, 14 Jul 2024 04:33:50 +0900 Subject: [PATCH] =?UTF-8?q?:lipstick:=20Design:=20ProjectRetro=20=EA=B7=B8?= =?UTF-8?q?=EB=A3=B9=20=EC=82=AD=EC=A0=9C=20=EB=AA=A8=EB=8B=AC=EC=B0=BD=20?= =?UTF-8?q?=ED=8D=BC=EB=B8=94=EB=A6=AC=EC=8B=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/projectRetro/DeleteModal.tsx | 38 +++++++++++ src/components/projectRetro/GroupList.tsx | 2 +- src/components/projectRetro/Modal.tsx | 18 +++-- src/pages/ProjectRetroPage.tsx | 10 ++- src/styles/projectRetro/DeleteModal.styles.ts | 66 +++++++++++++++++++ src/styles/projectRetro/Modal.styles.ts | 13 +++- 6 files changed, 135 insertions(+), 12 deletions(-) create mode 100644 src/components/projectRetro/DeleteModal.tsx create mode 100644 src/styles/projectRetro/DeleteModal.styles.ts diff --git a/src/components/projectRetro/DeleteModal.tsx b/src/components/projectRetro/DeleteModal.tsx new file mode 100644 index 0000000..5298831 --- /dev/null +++ b/src/components/projectRetro/DeleteModal.tsx @@ -0,0 +1,38 @@ +import { IoMdClose } from 'react-icons/io'; +import { RiFolder6Fill } from 'react-icons/ri'; +import * as S from '@/styles/projectRetro/DeleteModal.styles'; + +interface DeleteModalProps { + isClose: () => void; + // groupId: number; +} + +const DeleteModal: React.FC = ({ isClose }) => { + return ( + + + + + 회고 프로젝트 삭제 + + +
+ +
+ + 프로젝트1 {/* 프로젝트 이름 */} + 를 삭제하시겠습니까? +
+ Delete +
+
+
+
+ ); +}; + +export default DeleteModal; diff --git a/src/components/projectRetro/GroupList.tsx b/src/components/projectRetro/GroupList.tsx index d6e1d0c..a3b1593 100644 --- a/src/components/projectRetro/GroupList.tsx +++ b/src/components/projectRetro/GroupList.tsx @@ -22,6 +22,7 @@ const GroupList: React.FC = ({ groups }) => { return ( <> + {isModalOpen && setIsModalOpen(false)} type="edit" groupId={6} />} {groups.map(group => (
@@ -31,7 +32,6 @@ const GroupList: React.FC = ({ groups }) => { ))} - {isModalOpen && setIsModalOpen(false)} type="edit" groupId={6} />} ); }; diff --git a/src/components/projectRetro/Modal.tsx b/src/components/projectRetro/Modal.tsx index 41a3eed..4d250b7 100644 --- a/src/components/projectRetro/Modal.tsx +++ b/src/components/projectRetro/Modal.tsx @@ -13,6 +13,7 @@ import postImageToS3 from '@/api/imageApi/postImageToS3'; import { GetRetrospectiveGroup } from '@/api/retroGroupsApi/getGroup'; import postGroup from '@/api/retroGroupsApi/postGroup'; import ImageUpload from '@/components/createRetro/modal/ImageUpload'; +import DeleteModal from '@/components/projectRetro/DeleteModal'; import DescriptionInput from '@/components/projectRetro/DescriptionInput'; import TitleInput from '@/components/projectRetro/TitleInput'; import { useCustomToast } from '@/hooks/useCustomToast'; @@ -31,6 +32,11 @@ const Modal: React.FC = ({ isClose, type, groupId }) => { const statusList = ['ING', 'DONE']; const statusObj: { [key: string]: string } = { ING: 'IN_PROGRESS', DONE: 'COMPLETED' }; const availableOption = statusList.filter(statusList => statusList !== statusOption); + const [deleteModal, setDeleteModal] = useState(false); + + const handleDeleteModal = () => { + setDeleteModal(true); + }; const [requestData, setRequestData] = useState({ title: '', @@ -199,12 +205,16 @@ const Modal: React.FC = ({ isClose, type, groupId }) => {
)} - - {type === 'create' && 'Create'} - {type === 'edit' && 'Edit'} - + + + {type === 'create' && 'Create'} + {type === 'edit' && 'Edit'} + + {type === 'edit' && Delete} +
+ {deleteModal && setDeleteModal(false)} />} ); }; diff --git a/src/pages/ProjectRetroPage.tsx b/src/pages/ProjectRetroPage.tsx index 9997b16..6c16478 100644 --- a/src/pages/ProjectRetroPage.tsx +++ b/src/pages/ProjectRetroPage.tsx @@ -83,12 +83,10 @@ const ProjectRetro = () => { 사용법 -
- - - - -
+ + + + {isDescriptionOpen ? setIsDescriptionOpen(false)} /> : null} {isModalOpen && setIsModalOpen(false)} type="create" />} diff --git a/src/styles/projectRetro/DeleteModal.styles.ts b/src/styles/projectRetro/DeleteModal.styles.ts new file mode 100644 index 0000000..485f2fb --- /dev/null +++ b/src/styles/projectRetro/DeleteModal.styles.ts @@ -0,0 +1,66 @@ +import styled from 'styled-components'; + +export const Background = styled.div` + position: fixed; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.35); + z-index: 350; +`; + +export const Container = styled.div` + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 400; +`; + +export const Modal = styled.div` + margin-top: 20px; + display: flex; + flex-direction: column; + background-color: white; + border-radius: 5px; + width: 600px; + height: auto; +`; + +export const Top = styled.div` + padding: 10px; + display: flex; + align-items: center; + + justify-content: space-between; +`; + +export const Title = styled.p` + color: #6c6c6c; +`; + +export const Bottom = styled.div` + padding: 10px; + display: flex; + flex-direction: column; + align-items: center; +`; + +export const ProjectName = styled.span` + color: #111b47; + font-size: large; + margin: 0px 5px; + font-weight: bold; +`; + +export const Text = styled.span` + color: #111b47; +`; + +export const Button = styled.button` + color: white; + background-color: #111b47; + border-radius: 5px; + width: auto; + margin-left: auto; + padding: 3px 20px; +`; diff --git a/src/styles/projectRetro/Modal.styles.ts b/src/styles/projectRetro/Modal.styles.ts index 04afbb4..b376add 100644 --- a/src/styles/projectRetro/Modal.styles.ts +++ b/src/styles/projectRetro/Modal.styles.ts @@ -116,8 +116,19 @@ export const DefaultText = styled.p` color: #8d8d8d; `; +export const ButtonContainer = styled.div` + display: flex; + flex-direction: row-reverse; +`; + +export const DeleteButton = styled.button` + color: #ff0000; + border-radius: 5px; + border: 1px solid #ff0000; + padding: 3px 20px; +`; export const SubmitButton = styled.button` - margin-left: auto; + margin-left: 20px; color: white; background-color: #4991e4; padding: 3px 20px;