UNPKG

@aamodtgroup/frontity-gravity-forms

Version:

Gravity Forms extension for Frontity theme.

50 lines (46 loc) 1.68 kB
import Input from "../components/Input"; export const gfSubmit = { name: "gfSubmit", test: ({ node }) => node.component === "input" && node.props.type === "submit", processor: ({ node }) => { const ariaInvalid = "undefined" === typeof node.props["aria-invalid"] ? null : node.props["aria-invalid"]; const ariaRequired = "undefined" === typeof node.props["aria-required"] ? null : node.props["aria-required"]; const className = "undefined" === typeof node.props.className ? null : node.props.className; const id = "undefined" === typeof node.props.id ? null : node.props.id; const name = "undefined" === typeof node.props.type ? null : node.props.type; const size = "undefined" === typeof node.props.size ? null : node.props.size; const type = "undefined" === typeof node.props.type ? null : node.props.type; const value = "undefined" === typeof node.props.value ? null : node.props.value; const placeholder = "undefined" === typeof node.props.placeholder ? null : node.props.placeholder; node.props.inputProps = { ariaInvalid: ariaInvalid, ariaRequired: ariaRequired, className: className, id: id, name: name, size: size, type: type, value: value, placeholder: placeholder, }; node.component = Input; return node; }, };