// @flow import * as React from "react"; import { FormCard, FormTextInput, FormCheckboxInput, StandaloneFormPage, } from "../../../"; import withTouchedErrors from "../../../helpers/withTouchedErrors.react"; import defaultStrings from "./RegisterPage.strings"; import type { stringTypes } from "./RegisterPage.strings"; import type { FormEvents, FocusEvents } from "../../../"; type fieldTypes = {| name?: string, email?: string, password?: string, terms?: string, |}; type touchedTypes = {| name?: boolean, email?: boolean, password?: boolean, terms?: boolean, |}; type Props = {| ...FormEvents, ...FocusEvents, +strings?: stringTypes, +action?: string, +method?: string, +values?: fieldTypes, +errors?: fieldTypes, +touched?: touchedTypes, |}; /** * A register page * Can be easily wrapped with form libraries like formik and redux-form */ function RegisterPage(props: Props): React.Node { const { action, method, onSubmit, onChange, onBlur, values, strings = {}, errors, } = props; return ( ); } const RegisterPageWithTouchedErrors: React.ComponentType = withTouchedErrors( ["name", "email", "password", "terms"] )(RegisterPage); export default RegisterPageWithTouchedErrors;