From 8074d7aaf672c5f5c3ab740294ae13e43c83a81d Mon Sep 17 00:00:00 2001 From: Esnobart Date: Wed, 12 Jun 2024 20:07:50 +0100 Subject: [PATCH 1/3] Update TaskColumnName.jsx --- src/components/TaskColumnName/TaskColumnName.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/TaskColumnName/TaskColumnName.jsx b/src/components/TaskColumnName/TaskColumnName.jsx index b21af12..6c34e84 100644 --- a/src/components/TaskColumnName/TaskColumnName.jsx +++ b/src/components/TaskColumnName/TaskColumnName.jsx @@ -1,10 +1,10 @@ import css from "./TaskColumnName.module.css"; import svg from "../../img/icons.svg"; -import { useSelector} from "react" +import { useState } from "react" import { EditColumn } from "../EditColumnModal/EditColumnModal"; export const TaskColumnName = () => { - const [isOpen, setIsOpen] = useSelector(false); + const [isOpen, setIsOpen] = useState(false); const openModal = () => { setIsOpen(true) From 0bdad83bcb37797f69a95f38cd6b3360b2f1430c Mon Sep 17 00:00:00 2001 From: Esnobart Date: Wed, 12 Jun 2024 22:34:17 +0100 Subject: [PATCH 2/3] fix modals --- .../AddAnotherCardBtn/AddAnotherCardBtn.jsx | 12 +- src/components/AddColumnBtn/AddColumnBtn.jsx | 6 +- .../CreateCardModal/CreateCardModal.jsx | 124 +++++++++--------- .../CreateColumnModal/CreateColumnModal.jsx | 84 ++++++------ .../EditCardModal/EditCardModal.jsx | 124 +++++++++--------- .../EditColumnModal/EditColumnModal.jsx | 84 ++++++------ .../EditColumnModal.module.css | 32 +++-- src/components/TaskCard/TaskCard.jsx | 13 +- .../TaskColumnName/TaskColumnName.jsx | 12 +- 9 files changed, 245 insertions(+), 246 deletions(-) diff --git a/src/components/AddAnotherCardBtn/AddAnotherCardBtn.jsx b/src/components/AddAnotherCardBtn/AddAnotherCardBtn.jsx index 2d3f4e7..0779e89 100644 --- a/src/components/AddAnotherCardBtn/AddAnotherCardBtn.jsx +++ b/src/components/AddAnotherCardBtn/AddAnotherCardBtn.jsx @@ -1,17 +1,17 @@ import css from "./AddAnotherCardBtn.module.css"; import svg from "../../img/icons.svg"; import { useState } from "react"; -// import { CreateCard } from "../CreateCardModal/CreateCardModal.jsx" +import { CreateCard } from "../CreateCardModal/CreateCardModal.jsx" export const AddAnotherCardBtn = () => { - const [isOpen, setIsOpen] = useState(false) + const [createCardModal, setCreateCardModal] = useState(false) const openModal = () => { - setIsOpen(true) + setCreateCardModal(true) } const closeModal = () => { - setIsOpen(false) + setCreateCardModal(false) } return ( @@ -24,8 +24,8 @@ export const AddAnotherCardBtn = () => { Add another card - {/* {isOpen && - } */} + {createCardModal && + } ); }; diff --git a/src/components/AddColumnBtn/AddColumnBtn.jsx b/src/components/AddColumnBtn/AddColumnBtn.jsx index 091d88b..f3789ff 100644 --- a/src/components/AddColumnBtn/AddColumnBtn.jsx +++ b/src/components/AddColumnBtn/AddColumnBtn.jsx @@ -1,4 +1,4 @@ -// import { CreateColumn } from "../CreateColumnModal/CreateColumnModal"; +import { CreateColumn } from "../CreateColumnModal/CreateColumnModal"; import css from "./AddColumnBtn.module.css"; import { useState } from "react"; @@ -16,9 +16,9 @@ export const AddColumnBtn = () => { return (
- {/* {isOpen && ( + {isOpen && ( - )} */} + )}
); }; \ No newline at end of file diff --git a/src/components/CreateCardModal/CreateCardModal.jsx b/src/components/CreateCardModal/CreateCardModal.jsx index 88c1637..11c9463 100644 --- a/src/components/CreateCardModal/CreateCardModal.jsx +++ b/src/components/CreateCardModal/CreateCardModal.jsx @@ -1,67 +1,67 @@ -// import Modal from "react-modal"; -// import css from "./CreateCardModal.module.css"; -// import * as Yup from 'yup'; -// import { Form, Formik, Field } from "formik"; -// import svg from "../../img/icons.svg"; +import Modal from "react-modal"; +import css from "./CreateCardModal.module.css"; +import * as Yup from 'yup'; +import { Form, Formik, Field } from "formik"; +import svg from "../../img/icons.svg"; -// Modal.setAppElement('#root'); +Modal.setAppElement('#root'); -// export const CreateCard = ({ isOpen, isClose }) => { -// const columnModalValidation = Yup.object().shape({ -// columnname: Yup.string().min(3, 'Too short!').max(20, 'Too long!').required('Required!') -// }); +export const CreateCard = ({ isOpen, isClose }) => { + const columnModalValidation = Yup.object().shape({ + columnname: Yup.string().min(3, 'Too short!').max(20, 'Too long!').required('Required!') + }); -// return ( -// <> -// -// -//
-//

Add card

-// {}} -// > -//
-// -// -// + return ( + <> + + +
+

Add card

+ {}} + > + + + + -// -// -// -//
+ + +
+
-//
-// -// ) -// } \ No newline at end of file + + +) +} \ No newline at end of file diff --git a/src/components/CreateColumnModal/CreateColumnModal.jsx b/src/components/CreateColumnModal/CreateColumnModal.jsx index 9ad94b3..fa432c2 100644 --- a/src/components/CreateColumnModal/CreateColumnModal.jsx +++ b/src/components/CreateColumnModal/CreateColumnModal.jsx @@ -1,46 +1,46 @@ -// import Modal from "react-modal"; -// import css from "./CreateColumnModal.module.css"; -// import * as Yup from 'yup'; -// import { Form, Formik, Field } from "formik"; -// import svg from "../../img/icons.svg"; +import Modal from "react-modal"; +import css from "./CreateColumnModal.module.css"; +import * as Yup from 'yup'; +import { Form, Formik, Field } from "formik"; +import svg from "../../img/icons.svg"; -// Modal.setAppElement('#root'); +Modal.setAppElement('#root'); -// export const CreateColumn = ({ isOpen, isClose }) => { -// const columnModalValidation = Yup.object().shape({ -// columnname: Yup.string().min(3, 'Too short!').max(20, 'Too long!').required('Required!') -// }); +export const CreateColumn = ({ isOpen, isClose }) => { + const columnModalValidation = Yup.object().shape({ + columnname: Yup.string().min(3, 'Too short!').max(20, 'Too long!').required('Required!') + }); -// return ( -// <> -// isClose()} className={css.createColumnModal} overlayClassName={css.createColumnModalOverlay}> -// -//
-//

Add column

-// {}} -// > -//
-// -// -// -//
-//
-//
-// -// ) -// } \ No newline at end of file + return ( + <> + isClose()} className={css.createColumnModal} overlayClassName={css.createColumnModalOverlay}> + +
+

Add column

+ {}} + > +
+ + + +
+
+
+ +) +} \ No newline at end of file diff --git a/src/components/EditCardModal/EditCardModal.jsx b/src/components/EditCardModal/EditCardModal.jsx index f4db18e..80db8b3 100644 --- a/src/components/EditCardModal/EditCardModal.jsx +++ b/src/components/EditCardModal/EditCardModal.jsx @@ -1,67 +1,67 @@ -// import Modal from "react-modal"; -// import css from "./EditCardModal.module.css"; -// import * as Yup from 'yup'; -// import { Form, Formik, Field } from "formik"; -// import svg from "../../img/icons.svg"; +import Modal from "react-modal"; +import css from "./EditCardModal.module.css"; +import * as Yup from 'yup'; +import { Form, Formik, Field } from "formik"; +import svg from "../../img/icons.svg"; -// Modal.setAppElement('#root'); +Modal.setAppElement('#root'); -// export const EditCard = ({ isOpen, isClose }) => { -// const columnModalValidation = Yup.object().shape({ -// columnname: Yup.string().min(3, 'Too short!').max(20, 'Too long!').required('Required!') -// }); +export const EditCard = ({ isOpen, isClose }) => { + const columnModalValidation = Yup.object().shape({ + columnname: Yup.string().min(3, 'Too short!').max(20, 'Too long!').required('Required!') + }); -// return ( -// <> -// -// -//
-//

Edit card

-// {}} -// > -//
-// -// -// + return ( + <> + + +
+

Edit card

+ {}} + > + + + + -// -// -// -//
+ + +
+
-//
-// -// ) -// } \ No newline at end of file + + +) +} \ No newline at end of file diff --git a/src/components/EditColumnModal/EditColumnModal.jsx b/src/components/EditColumnModal/EditColumnModal.jsx index add98a5..25033d3 100644 --- a/src/components/EditColumnModal/EditColumnModal.jsx +++ b/src/components/EditColumnModal/EditColumnModal.jsx @@ -1,46 +1,46 @@ -// import Modal from "react-modal"; -// import css from "./EditColumnModal.module.css"; -// import * as Yup from 'yup'; -// import { Form, Formik, Field } from "formik"; -// import svg from "../../img/icons.svg"; +import Modal from "react-modal"; +import css from "./EditColumnModal.module.css"; +import * as Yup from 'yup'; +import { Form, Formik, Field } from "formik"; +import svg from "../../img/icons.svg"; -// Modal.setAppElement('#root'); +Modal.setAppElement('#root'); -// export const EditColumn = ({ isOpen, isClose, title }) => { -// const columnModalValidation = Yup.object().shape({ -// columnname: Yup.string().min(3, 'Too short!').max(20, 'Too long!').required('Required!') -// }); +export const EditColumn = ({ isOpen, isClose, title }) => { + const columnModalValidation = Yup.object().shape({ + columnname: Yup.string().min(3, 'Too short!').max(20, 'Too long!').required('Required!') + }); -// return ( -// <> -// isClose()} className={css.editColumnModal} overlayClassName={css.editColumnModalOverlay}> -// -//
-//

Edit column

-// {}} -// > -//
-// -// -// -//
-//
-//
-// -// ) -// } \ No newline at end of file + return ( + <> + isClose()} className={css.editColumnModal} overlayClassName={css.editColumnModalOverlay}> + +
+

Edit column

+ {}} + > +
+ + + +
+
+
+ +) +} \ No newline at end of file diff --git a/src/components/EditColumnModal/EditColumnModal.module.css b/src/components/EditColumnModal/EditColumnModal.module.css index e32431a..21e8d04 100644 --- a/src/components/EditColumnModal/EditColumnModal.module.css +++ b/src/components/EditColumnModal/EditColumnModal.module.css @@ -89,22 +89,6 @@ cursor: pointer; } -.editColumnModalSubmitAddBtn { - display: flex; - align-items: center; - justify-content: center; - padding: 8px 16px; - font-size: 14px; - font-weight: 500; - background-color: #bedbb0; - color: rgba(22, 22, 22, 1); - border: none; - width: 287px; - height: 49px; - border-radius: 8px; - cursor: pointer; -} - .editColumnModalSpan { width: 28px; height: 28px; @@ -119,4 +103,18 @@ .editColumnModalAddIcon { stroke: white; -} \ No newline at end of file +} + +@media screen and (min-width: 768px) { + .editColumnModal { + width: 350px; + } + + .editColumnModalInput { + width: 302px; + } + + .editColumnModalSubmit { + width: 302px; + } + } \ No newline at end of file diff --git a/src/components/TaskCard/TaskCard.jsx b/src/components/TaskCard/TaskCard.jsx index ef3e4d8..80d0ab9 100644 --- a/src/components/TaskCard/TaskCard.jsx +++ b/src/components/TaskCard/TaskCard.jsx @@ -1,17 +1,17 @@ import css from "./TaskCard.module.css" import svg from "../../img/icons.svg"; -// import { EditCard } from "../EditCardModal/EditCardModal"; +import { EditCard } from "../EditCardModal/EditCardModal"; import { useState } from "react"; export const Card = () => { - const [isOpen, setIsOpen] = useState(false); + const [editCardModal, setEditCardModal] = useState(false); const openModal = () => { - setIsOpen(true) + setEditCardModal(true) } const closeModal = () => { - setIsOpen(false) + setEditCardModal(false) } return ( @@ -53,7 +53,7 @@ export const Card = () => { - {/* {isOpen && - } */} + {taskColumnModal && + } ); }; From de70865ec9a524d7f2e3bddb4116dfbfcc26484f Mon Sep 17 00:00:00 2001 From: Esnobart Date: Thu, 13 Jun 2024 18:14:31 +0100 Subject: [PATCH 3/3] final modals --- .../CreateCardModal/CreateCardModal.jsx | 2 +- .../CreateCardModal.module.css | 31 +++- .../CreateColumnModal.module.css | 16 +- .../EditCardModal/EditCardModal.jsx | 14 +- .../EditCardModal/EditCardModal.module.css | 146 ++++++++++++++++-- .../MainDashboard/MainDashboard.jsx | 2 +- src/components/TaskCard/TaskCard.module.css | 2 +- 7 files changed, 188 insertions(+), 25 deletions(-) diff --git a/src/components/CreateCardModal/CreateCardModal.jsx b/src/components/CreateCardModal/CreateCardModal.jsx index 11c9463..c1fadef 100644 --- a/src/components/CreateCardModal/CreateCardModal.jsx +++ b/src/components/CreateCardModal/CreateCardModal.jsx @@ -29,7 +29,7 @@ export const CreateCard = ({ isOpen, isClose }) => {
-