diff --git a/src/components/FieldsWrapper.jsx b/src/components/FieldsWrapper.jsx new file mode 100644 index 0000000..25b94a4 --- /dev/null +++ b/src/components/FieldsWrapper.jsx @@ -0,0 +1,12 @@ +import PropTypes from "prop-types"; + +function FieldsWrapper({ children, className = "" }) { + return
{children}
; +} + +FieldsWrapper.propTypes = { + children: PropTypes.node, + className: PropTypes.string, +}; + +export default FieldsWrapper; diff --git a/src/components/FormHeader.jsx b/src/components/FormHeader.jsx index 6ad3d50..b3b5028 100644 --- a/src/components/FormHeader.jsx +++ b/src/components/FormHeader.jsx @@ -1,7 +1,7 @@ import PropTypes from "prop-types"; function FormHeader({ text }) { - return

{text}

; + return

{text}

; } FormHeader.propTypes = { diff --git a/src/components/FormInput.jsx b/src/components/FormInput.jsx index cc550ea..b028796 100644 --- a/src/components/FormInput.jsx +++ b/src/components/FormInput.jsx @@ -2,29 +2,15 @@ import PropTypes from "prop-types"; import { motion, AnimatePresence } from "motion/react"; import clsx from "clsx"; -function FormInput({ - value, - onChange, - placeholder, - valid = true, - maxLength = 17, - readOnly = false, - className = "", - type = "text", -}) { +function FormInput({ props, valid = true, className = "" }) { return (
{!valid && ( @@ -44,14 +30,9 @@ function FormInput({ } FormInput.propTypes = { - value: PropTypes.string.isRequired, - onChange: PropTypes.func.isRequired, - readOnly: PropTypes.bool, - className: PropTypes.string, - type: PropTypes.string, - maxLength: PropTypes.number, + props: PropTypes.object, valid: PropTypes.bool, - placeholder: PropTypes.string, + className: PropTypes.string, }; export default FormInput; diff --git a/src/components/FormSelect.jsx b/src/components/FormSelect.jsx index f779b68..ce876f8 100644 --- a/src/components/FormSelect.jsx +++ b/src/components/FormSelect.jsx @@ -3,21 +3,20 @@ import { AnimatePresence } from "motion/react"; import clsx from "clsx"; import FieldError from "./FieldError"; -function FormSelect({ value, onChange, options, className, valid = true }) { +function FormSelect({ props, valid = true, className = "", options }) { return (