import React, { Component, PropTypes } from 'react'; import Form from 'components/forms/Form'; import formFieldInterface from 'interfaces/form_field'; import Button from 'components/buttons/Button'; import InputFieldWithIcon from 'components/forms/fields/InputFieldWithIcon'; import helpers from './helpers'; const formFields = ['username', 'password', 'password_confirmation', 'email']; const { validate } = helpers; class AdminDetails extends Component { static propTypes = { className: PropTypes.string, currentPage: PropTypes.bool, fields: PropTypes.shape({ email: formFieldInterface.isRequired, password: formFieldInterface.isRequired, password_confirmation: formFieldInterface.isRequired, username: formFieldInterface.isRequired, }).isRequired, handleSubmit: PropTypes.func.isRequired, }; render () { const { className, currentPage, fields, handleSubmit } = this.props; const tabIndex = currentPage ? 1 : -1; return (
); } } export default Form(AdminDetails, { fields: formFields, validate, });