From 85e8def2d24a0746bf21fde5c4c7005f85f65bb7 Mon Sep 17 00:00:00 2001 From: Jonathanhammer Date: Sun, 7 May 2023 16:04:17 +0300 Subject: [PATCH 01/22] modal-component --- frontend/src/components/ui/Modal/Modal.js | 31 ++++++++++++++ .../src/components/ui/Modal/Modal.module.css | 41 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 frontend/src/components/ui/Modal/Modal.js create mode 100644 frontend/src/components/ui/Modal/Modal.module.css diff --git a/frontend/src/components/ui/Modal/Modal.js b/frontend/src/components/ui/Modal/Modal.js new file mode 100644 index 0000000..41bf4bc --- /dev/null +++ b/frontend/src/components/ui/Modal/Modal.js @@ -0,0 +1,31 @@ +import { IoClose } from 'react-icons/io5'; +import PropTypes from 'prop-types'; +import styles from './Modal.module.css'; +import ModalNewComment from '../../ModalNewComment/ModalNewComment'; +import ModalNewPost from '../../ModalNewPost/ModalNewPost'; + +function Modal({ title, onClose, children, footer, isPostModal, post }) { + const handleClose = () => { + if (onClose) { + onClose(); + } + }; + return ( +
+
+ + {isPostModal ? : } +
+
+ ); +} + +Modal.propTypes = { + title: PropTypes.string, + onClose: PropTypes.func.isRequired, + children: PropTypes.node, + footer: PropTypes.node, + isPostModal: PropTypes.bool, +}; + +export default Modal; diff --git a/frontend/src/components/ui/Modal/Modal.module.css b/frontend/src/components/ui/Modal/Modal.module.css new file mode 100644 index 0000000..5e9ba0d --- /dev/null +++ b/frontend/src/components/ui/Modal/Modal.module.css @@ -0,0 +1,41 @@ +.modal_background { + width: 100%; + height: 100%; + z-index: 1; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + position: fixed; +} + +.modal_container { + position: relative; + left: 8.125rem; + top: 3.75rem; + width: 74rem; + height: 45rem; + background: rgba(0, 0, 0, 0.49); + border: .0625rem solid rgba(255, 255, 255, 0.1); + border-radius: .125rem; +} + +.close_icon { + position: fixed; + right: 7.9375rem; + fill: var(--white); + height: 2rem; + width: 2rem; + cursor: pointer; +} + +.modal_body { + display: flex; + flex-direction: row; +} + +.footer { + position: relative; + display: flex; + justify-content: space-evenly; + top: 11.25rem; +} From 239d14c9ca1d08eb7f9ef1c258db6cfd83ea6169 Mon Sep 17 00:00:00 2001 From: Jonathanhammer Date: Sun, 7 May 2023 16:04:56 +0300 Subject: [PATCH 02/22] new comment modal --- .../ModalNewComment/ModalNewComment.js | 27 +++++++++ .../ModalNewComment.module.css | 56 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 frontend/src/components/ModalNewComment/ModalNewComment.js create mode 100644 frontend/src/components/ModalNewComment/ModalNewComment.module.css diff --git a/frontend/src/components/ModalNewComment/ModalNewComment.js b/frontend/src/components/ModalNewComment/ModalNewComment.js new file mode 100644 index 0000000..36fd920 --- /dev/null +++ b/frontend/src/components/ModalNewComment/ModalNewComment.js @@ -0,0 +1,27 @@ +import styles from './ModalNewComment.module.css'; +import Input from '../ui/Input/input'; +import Button from '../ui/Button/Button'; + +function ModalNewComment({ title, post }) { + return ( +
+

{title}

+

{post.location}

+
+ post +
+
+
+
    + {post.comments.map((comment) => ( +
  • {comment}
  • + ))} +
+
+ +
+
+ ); +} +export default ModalNewComment; diff --git a/frontend/src/components/ModalNewComment/ModalNewComment.module.css b/frontend/src/components/ModalNewComment/ModalNewComment.module.css new file mode 100644 index 0000000..5d7315a --- /dev/null +++ b/frontend/src/components/ModalNewComment/ModalNewComment.module.css @@ -0,0 +1,56 @@ +.comment_title { + position: relative; + display: flex; + width: 18.19rem; + top: 4.375rem; + left: 3.75rem; +} +.comment_subTitle { + position: fixed; + top: 12.5rem; + left: 12.19rem; +} + +.comment_image { + background-color: var(--black); + position: relative; + display: inline-block; + height: 23rem; + width: 31.9375rem; + left: 3.625rem; + top: 7.9375rem; +} +.image { + width: 100%; + height: 100%; +} +.comment_body { + position: relative; + float: right; + padding: 5rem; +} + +.comments { + position: relative; + overflow-y: auto; + width: 24.68rem; + height: 22.5rem; + left: 0.625rem; + background-color: #d9d9d9; +} + +.send_button { + position: relative; + left: 17.5rem; + height: 3.75rem; + width: 7.81rem; + border: none; +} +.list_item { + list-style-position: inside; + content: normal; + padding: 1.25rem; +} +li::marker { + content: normal; +} From 466f61a3e13c602f3394863261f4c844ac15cb75 Mon Sep 17 00:00:00 2001 From: Jonathanhammer Date: Sun, 7 May 2023 16:05:32 +0300 Subject: [PATCH 03/22] modal for new Post --- .../components/ModalNewPost/ModalNewPost.js | 31 ++++++++++++ .../ModalNewPost/ModalNewPost.module.css | 48 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 frontend/src/components/ModalNewPost/ModalNewPost.js create mode 100644 frontend/src/components/ModalNewPost/ModalNewPost.module.css diff --git a/frontend/src/components/ModalNewPost/ModalNewPost.js b/frontend/src/components/ModalNewPost/ModalNewPost.js new file mode 100644 index 0000000..7cfd4ba --- /dev/null +++ b/frontend/src/components/ModalNewPost/ModalNewPost.js @@ -0,0 +1,31 @@ +import styles from './ModalNewPost.module.css'; +import Input from '../ui/Input/input'; +import Textarea from '../ui/Textarea/Textarea'; +import UploadFile from '../UploadFile/UploadFile'; + +function ModalNewPost({ title, footer }) { + return ( +
+
+

{title}

+
+
+
+ +
+
+
+
+

Title

+ +

Location

+ +

Description

+