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 ( +
+ ); +} + +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" ? ( + + ) : type === "file" ? ( + + ) : ( + + )} + > + ); +} + +export default Field; \ No newline at end of file diff --git a/src/components/Field/Field.styles.scss b/src/components/Field/Field.styles.scss new file mode 100644 index 0000000..63c4d6f --- /dev/null +++ b/src/components/Field/Field.styles.scss @@ -0,0 +1,56 @@ +.field { + padding: 12px 16px; + border: none; + border-radius: 8px; + + font-size: 16px; + font-weight: 400; +} + +.field.big { + height: 200px; + line-height: 30px; + resize: none; +} + +.file-input { + position: relative; + width: fit-content; + + input { + position: absolute; + z-index: -1; + opacity: 0; + display: block; + width: 0; + height: 0; + } + + .upload-file-btn { + display: flex; + cursor: pointer; + + .icon { + margin-right: 6px; + height: 22px; + } + + span { + display: inline-block; + font-size: 18px; + } + } +} + +.file-input input:focus + .upload-file-btn { + outline: -webkit-focus-ring-color auto 1px; +} + +.submit { + width: 100%; + cursor: pointer; + + padding: 12px; + font-size: 18px; + line-height: normal; +} \ No newline at end of file diff --git a/src/components/Field/index.js b/src/components/Field/index.js new file mode 100644 index 0000000..e90acef --- /dev/null +++ b/src/components/Field/index.js @@ -0,0 +1 @@ +export { default } from './Field'; \ No newline at end of file diff --git a/src/pages/Main/components/ContactUs/ContactUs.jsx b/src/pages/Main/components/ContactUs/ContactUs.jsx index f458365..f7d71ca 100755 --- a/src/pages/Main/components/ContactUs/ContactUs.jsx +++ b/src/pages/Main/components/ContactUs/ContactUs.jsx @@ -1,28 +1,12 @@ -import { Form } from "react-router-dom"; +import ContactForm from "../../../../components/ContactForm" -import { fileUpload } from "../../../../assets/images"; import './ContactUs.styles.scss'; function ContactUs() { return (