From 18051f37059112718d5d327ec15fcd398b0a58cf Mon Sep 17 00:00:00 2001 From: Mikola Date: Mon, 13 Nov 2023 19:05:17 +0300 Subject: [PATCH] fixes --- src/components/Footer/footer.scss | 4 +- src/components/Header/header.scss | 8 +- src/components/Modal/Modal.js | 106 +++++++++++++ src/components/Modal/modal.scss | 145 ++++++++++++++++++ .../ModalAddAuction/ModalAddAuction.js | 40 ----- .../ModalAddAuction/modalAddAuction.scss | 46 ------ .../ModalEditAuction/ModalEditAuction.js | 55 ------- .../ModalEditAuction/modalEditAuction.scss | 46 ------ src/components/SocialItem/socialItem.scss | 2 +- src/pages/Home/Home.js | 15 +- src/pages/Home/home.scss | 10 +- 11 files changed, 275 insertions(+), 202 deletions(-) create mode 100644 src/components/Modal/Modal.js create mode 100644 src/components/Modal/modal.scss delete mode 100644 src/components/ModalAddAuction/ModalAddAuction.js delete mode 100644 src/components/ModalAddAuction/modalAddAuction.scss delete mode 100644 src/components/ModalEditAuction/ModalEditAuction.js delete mode 100644 src/components/ModalEditAuction/modalEditAuction.scss diff --git a/src/components/Footer/footer.scss b/src/components/Footer/footer.scss index 27ef198..0945b2c 100644 --- a/src/components/Footer/footer.scss +++ b/src/components/Footer/footer.scss @@ -1,6 +1,6 @@ .footer { padding: 50px 0 35px; - background-color: #4d4d4d; + background-color: #2f95f2; color: white; height: 450px; @@ -58,7 +58,7 @@ max-width: 250px; color: white; font-weight: 600; - background-color: gray; + background-color: #00529d; } } diff --git a/src/components/Header/header.scss b/src/components/Header/header.scss index 3e39013..5bb0533 100644 --- a/src/components/Header/header.scss +++ b/src/components/Header/header.scss @@ -1,6 +1,8 @@ .header { - background: gray; + background: #2f95f2; + padding: 10px 0; position: relative; + color: white; &__logo { font-size: 30px; @@ -45,7 +47,7 @@ border-radius: 50px; width: 30px; height: 30px; - background-color: #b0aeae; + background-color: #0d8afb; img { width: 28px; @@ -82,7 +84,7 @@ display: none; flex-direction: column; border-radius: 8px; - background-color: #d9d9d9; + background-color: #0270d5; padding: 10px; position: absolute; right: 10px; diff --git a/src/components/Modal/Modal.js b/src/components/Modal/Modal.js new file mode 100644 index 0000000..05c801e --- /dev/null +++ b/src/components/Modal/Modal.js @@ -0,0 +1,106 @@ +import React, {useState, useEffect} from "react"; + +import ModalLayout from "../ModalLayout/ModalLayout"; + +import closeImg from "../../assets/images/closeBurger.png" + +import "./modal.scss"; + +export const Modal = ({ + active, + close, + currentAuction, + setAuctionItems, + type +}) => { + const [newAuctionName, setNewAuctionName] = useState('') + const [addAuctionName, setAddNewAuctionName] = useState('') + useEffect(() => { + currentAuction ? setNewAuctionName(currentAuction.name) : setNewAuctionName('') + }, [currentAuction]) + + const onChangeHandler = (e) => { + setNewAuctionName(e.target.value) + } + + const editAuction = () => { + setAuctionItems((prevValue) => { + return prevValue.map((item) => { + if (item.number === currentAuction.number) { + return {...item, name: newAuctionName} + } + return item + }) + }) + close(false) + } + + const addNewAuction = () => { + setAuctionItems((prevValue) => [...prevValue, { + number: prevValue.length + 1, + name: addAuctionName, + receptionDate: '17.04.23-18.04.23', + startDate: '18.04.23', + status: 'Сбор заявок' + }]) + setAddNewAuctionName('') + close(false) + } + + return ( + +
+ close close(false)} /> + {type === 'edit' && +
+

Редактировать аукцион

+
+ Название аукциона* + +
+
+ Комментарий к аукциону* +