mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 05:19:45 +00:00
Изменил компонент контактной формы, теперь более гибкий в стилизации. Изменил стили под конкретные страницы для формы
This commit is contained in:
1 parent
9fa6b820fb
commit
439bfca774
5 files changed
+99
-59
No files matched your search
@@ -6,51 +6,43 @@ import "./ContactForm.styles.scss";
|
|||||||
|
|
||||||
import { fileUpload } from "../../assets/images";
|
import { fileUpload } from "../../assets/images";
|
||||||
|
|
||||||
const mock = [
|
function ContactForm() {
|
||||||
{
|
|
||||||
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 (
|
return (
|
||||||
<Form method="post" className="half contact-form">
|
<Form method="post" className="half contact-form">
|
||||||
<h2>Свяжитесь с нами!</h2>
|
<h2>Свяжитесь с нами!</h2>
|
||||||
<div className="inputs">
|
<div className="inputs">
|
||||||
{fields.map(item =>
|
<div className="row">
|
||||||
<Field
|
<Field
|
||||||
key={item.id}
|
key={1}
|
||||||
type={item.type}
|
type="text"
|
||||||
name={item.name}
|
name="name"
|
||||||
placeholder={item.placeholder}
|
placeholder="Имя"
|
||||||
icon={item.icon}
|
|
||||||
/>
|
/>
|
||||||
)}
|
<Field
|
||||||
|
key={2}
|
||||||
|
type="email"
|
||||||
|
name="email"
|
||||||
|
placeholder="E-mail"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Field
|
||||||
|
key={3}
|
||||||
|
type="textarea"
|
||||||
|
name="text"
|
||||||
|
placeholder="Опишите в этом поле свой проект и, по возможности, прикрепите файл с ТЗ"
|
||||||
|
/>
|
||||||
|
<div className="row">
|
||||||
|
<Field
|
||||||
|
key={4}
|
||||||
|
type="file"
|
||||||
|
name="file"
|
||||||
|
icon={fileUpload}
|
||||||
|
/>
|
||||||
|
<Field
|
||||||
|
key={5}
|
||||||
|
type="submit"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
@import "../../assets/styles/theme.scss";
|
@import "../../assets/styles/theme.scss";
|
||||||
|
$icon-size: 24px;
|
||||||
|
$color-file-button: rgb(7, 42, 200);
|
||||||
|
|
||||||
.contact-form {
|
.contact-form {
|
||||||
padding: 20px 22px;
|
padding: 20px 22px;
|
||||||
@@ -18,11 +20,32 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 14px;
|
gap: 14px;
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
display: flex;
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-input * {
|
||||||
|
width: fit-content;
|
||||||
|
color: $color-file-button;
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
height: $icon-size;
|
||||||
|
width: $icon-size;
|
||||||
|
filter: invert(15%) sepia(100%) saturate(2861%) hue-rotate(229deg) brightness(93%) contrast(120%);;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.submit {
|
.submit {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import "./Contact.styles.scss";
|
|||||||
|
|
||||||
function Contact() {
|
function Contact() {
|
||||||
return (
|
return (
|
||||||
<>
|
<div id="page-contact">
|
||||||
<PageHeader>
|
<PageHeader>
|
||||||
<div className="top-block">
|
<div className="top-block">
|
||||||
<div>
|
<div>
|
||||||
@@ -37,7 +37,7 @@ function Contact() {
|
|||||||
<PageContent>
|
<PageContent>
|
||||||
<ContactForm />
|
<ContactForm />
|
||||||
</PageContent>
|
</PageContent>
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,41 @@
|
|||||||
.top-block {
|
#page-contact {
|
||||||
display: flex;
|
.top-block {
|
||||||
flex-wrap: wrap;
|
display: flex;
|
||||||
justify-content: space-between;
|
flex-wrap: wrap;
|
||||||
flex: 1 1 50%;
|
justify-content: space-between;
|
||||||
|
flex: 1 1 50%;
|
||||||
|
|
||||||
div:has(> ymaps) {
|
div:has(> ymaps) {
|
||||||
|
|
||||||
ymaps[class*="inner-panes"] {
|
ymaps[class*="inner-panes"] {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// div:has(> ymaps)
|
||||||
|
div:has(> ymaps)>* {
|
||||||
|
width: auto !important;
|
||||||
|
height: 100% !important;
|
||||||
|
aspect-ratio: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// div:has(> ymaps)
|
.contact-form {
|
||||||
div:has(> ymaps) > *
|
.row {
|
||||||
{
|
flex-direction: row;
|
||||||
width: auto!important;
|
flex-wrap: wrap;
|
||||||
height: 100%!important;
|
justify-content: space-between;
|
||||||
aspect-ratio: 1;
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row:not(:has(.submit))>* {
|
||||||
|
flex: 1 1 calc(50% - 7px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.row:has(.submit)>* {
|
||||||
|
margin: 0;
|
||||||
|
flex: 1 1 calc(50% - 7px);
|
||||||
|
max-width: 35%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,14 +1,19 @@
|
|||||||
#contact-us {
|
#contact-us {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 60px;
|
gap: 60px;
|
||||||
|
|
||||||
.half {
|
.half {
|
||||||
flex: 0 0 50%;
|
flex: 1 1 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contact-form {
|
.contact-form {
|
||||||
max-width: 500px;
|
flex: 1 1 35%;
|
||||||
|
|
||||||
|
.row {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user