import PropTypes from 'prop-types'; import React from 'react'; import { domOnlyProps } from '../../../utils/reduxFormUtils'; import Button from '../../../common/Button'; function AccountForm(props) { const { fields: { username, email, currentPassword, newPassword }, user, handleSubmit, initiateVerification, submitting, invalid, pristine } = props; const handleInitiateVerification = (evt) => { evt.preventDefault(); initiateVerification(); }; return (
); } AccountForm.propTypes = { fields: PropTypes.shape({ username: PropTypes.object.isRequired, email: PropTypes.object.isRequired, currentPassword: PropTypes.object.isRequired, newPassword: PropTypes.object.isRequired, }).isRequired, user: PropTypes.shape({ verified: PropTypes.number.isRequired, emailVerificationInitiate: PropTypes.bool.isRequired, }).isRequired, handleSubmit: PropTypes.func.isRequired, initiateVerification: PropTypes.func.isRequired, updateSettings: PropTypes.func.isRequired, submitting: PropTypes.bool, invalid: PropTypes.bool, pristine: PropTypes.bool, }; AccountForm.defaultProps = { submitting: false, pristine: true, invalid: false }; export default AccountForm;