mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 03:39:45 +00:00
Пересборка контактной формы, вынос полей в отдельный компонент
This commit is contained in:
1 parent
87596e4411
commit
9e1c2c385a
8 files changed
+173
-96
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import "./Field.styles.scss";
|
||||
|
||||
function Field({ type, name, placeholder, icon }) {
|
||||
const className = type === "submit" ? "submit btn" : "field";
|
||||
|
||||
return (
|
||||
<>
|
||||
{type === "textarea" ? (
|
||||
<textarea
|
||||
className="field big"
|
||||
name={name}
|
||||
placeholder={placeholder}
|
||||
/>
|
||||
) : type === "file" ? (
|
||||
<label className="file-input">
|
||||
<input type="file" name="file" />
|
||||
<div className="upload-file-btn">
|
||||
<img src={icon} alt="" className="icon" />
|
||||
<span>Прикрепить файл</span>
|
||||
</div>
|
||||
</label>
|
||||
) : (
|
||||
<input
|
||||
className={className}
|
||||
type={type}
|
||||
name={name}
|
||||
placeholder={placeholder}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Field;
|
||||
Reference in new issue
Block a user