From 9e1c2c385ada79510259e43fe700f1c48d1cd3fa Mon Sep 17 00:00:00 2001 From: Ifraim Solomonov Date: Wed, 28 Feb 2024 14:20:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D1=81=D0=B1=D0=BE?= =?UTF-8?q?=D1=80=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D1=84=D0=BE=D1=80=D0=BC=D1=8B,=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=BD=D0=BE=D1=81=20=D0=BF=D0=BE=D0=BB=D0=B5=D0=B9=20?= =?UTF-8?q?=D0=B2=20=D0=BE=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ContactForm/ContactForm.jsx | 59 ++++++++++++++ .../ContactForm/ContactForm.styles.scss | 20 +++++ src/components/ContactForm/index.js | 1 + src/components/Field/Field.jsx | 34 ++++++++ src/components/Field/Field.styles.scss | 56 +++++++++++++ src/components/Field/index.js | 1 + .../Main/components/ContactUs/ContactUs.jsx | 20 +---- .../ContactUs/ContactUs.styles.scss | 78 ------------------- 8 files changed, 173 insertions(+), 96 deletions(-) create mode 100644 src/components/ContactForm/ContactForm.jsx create mode 100644 src/components/ContactForm/ContactForm.styles.scss create mode 100644 src/components/ContactForm/index.js create mode 100644 src/components/Field/Field.jsx create mode 100644 src/components/Field/Field.styles.scss create mode 100644 src/components/Field/index.js diff --git a/src/components/ContactForm/ContactForm.jsx b/src/components/ContactForm/ContactForm.jsx new file mode 100644 index 0000000..f503fb8 --- /dev/null +++ b/src/components/ContactForm/ContactForm.jsx @@ -0,0 +1,59 @@ +import { Form } from "react-router-dom"; + +import Field from "../Field"; + +import "./ContactForm.styles.scss"; + +import { fileUpload } from "../../assets/images"; + +const mock = [ + { + id: 1, + type: "text", + name: "name", + placeholder: "Имя", + }, + { + id: 2, + type: "email", + name: "email", + placeholder: "E-mail", + }, + { + id: 3, + type: "textarea", + name: "text", + placeholder: "Опишите в этом поле свой проект и, по возможности, прикрепите файл с ТЗ", + }, + { + id: 4, + type: "file", + name: "file", + icon: fileUpload, + }, + { + id: 5, + type: "submit", + } +]; + +function ContactForm({ fields = mock }) { + return ( +
+

Свяжитесь с нами!

+
+ {fields.map(item => + + )} +
+
+ ); +} + +export default ContactForm; \ No newline at end of file diff --git a/src/components/ContactForm/ContactForm.styles.scss b/src/components/ContactForm/ContactForm.styles.scss new file mode 100644 index 0000000..fdcecc8 --- /dev/null +++ b/src/components/ContactForm/ContactForm.styles.scss @@ -0,0 +1,20 @@ +.contact-form { + padding: 24px 26px; + border-radius: 16px; + + background-color: #EDEDED; + + h2 { + margin-top: 0; + + font-size: 26px; + font-weight: 500; + line-height: 30px; + } + + .inputs { + display: flex; + flex-direction: column; + gap: 16px; + } +} \ No newline at end of file diff --git a/src/components/ContactForm/index.js b/src/components/ContactForm/index.js new file mode 100644 index 0000000..ffe6eb7 --- /dev/null +++ b/src/components/ContactForm/index.js @@ -0,0 +1 @@ +export { default } from './ContactForm'; \ No newline at end of file diff --git a/src/components/Field/Field.jsx b/src/components/Field/Field.jsx new file mode 100644 index 0000000..ecf6f9e --- /dev/null +++ b/src/components/Field/Field.jsx @@ -0,0 +1,34 @@ +import "./Field.styles.scss"; + +function Field({ type, name, placeholder, icon }) { + const className = type === "submit" ? "submit btn" : "field"; + + return ( + <> + {type === "textarea" ? ( +