|
1 | 1 | import PropTypes from 'prop-types'; |
2 | 2 | import React from 'react'; |
3 | | -import { connect } from 'react-redux'; |
| 3 | +import { reduxForm } from 'redux-form'; |
4 | 4 | import { bindActionCreators } from 'redux'; |
5 | 5 | import { browserHistory } from 'react-router'; |
6 | 6 | import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; |
7 | 7 | import InlineSVG from 'react-inlinesvg'; |
| 8 | +import axios from 'axios'; |
8 | 9 | import { Helmet } from 'react-helmet'; |
9 | 10 | import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions'; |
10 | 11 | import AccountForm from '../components/AccountForm'; |
@@ -113,4 +114,10 @@ AccountView.propTypes = { |
113 | 114 | theme: PropTypes.string.isRequired |
114 | 115 | }; |
115 | 116 |
|
116 | | -export default connect(mapStateToProps, mapDispatchToProps)(AdvancedSettingsView); |
| 117 | +export default reduxForm({ |
| 118 | + form: 'updateAllSettings', |
| 119 | + fields: ['username', 'email', 'currentPassword', 'newPassword'], |
| 120 | + validate: validateSettings, |
| 121 | + asyncValidate, |
| 122 | + asyncBlurFields: ['username', 'email', 'currentPassword'] |
| 123 | +}, mapStateToProps, mapDispatchToProps)(AccountView); |
0 commit comments