import PropTypes from 'prop-types'; import React from 'react'; import { withTranslation } from 'react-i18next'; 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, t } = 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, t: PropTypes.func.isRequired }; AccountForm.defaultProps = { submitting: false, pristine: true, invalid: false }; export default withTranslation()(AccountForm);