Guest User

Untitled

a guest
Jun 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { connect } from 'react-redux';
  3. import { getTranslate } from 'react-localize-redux';
  4.  
  5. function mapStateToProps(state) {
  6. return {
  7. t: getTranslate(state.locale)
  8. };
  9. }
  10.  
  11. export default connect(
  12. mapStateToProps
  13. )(
  14. ({ t }) => ({
  15. e001: t('wrong_format'),
  16. e002: t('invalid_email'),
  17. })
  18. );
  19.  
  20. import React, { Component } from 'react';
  21. import { connect } from 'react-redux';
  22. import { getTranslate } from 'react-localize-redux';
  23. import { Field, reduxForm } from 'redux-form';
  24. import Error from './Error';
  25.  
  26. const validate = (values) => {
  27. console.log('error: ', Error);
  28. // Process validate redux-form with messages from Error.js
  29. };
  30.  
  31. class SignIn extends Component {
  32. // Process login form with redux-form
  33. }
  34.  
  35. function mapStateToProps(state) {
  36. return {
  37. t: getTranslate(state.locale),
  38. };
  39. }
  40.  
  41. const SignInForm = {
  42. form: 'SignIn',
  43. validate,
  44. };
  45.  
  46. export default connect(
  47. mapStateToProps
  48. )(
  49. reduxForm(SignInForm)(
  50. SignIn
  51. )
  52. );
Add Comment
Please, Sign In to add comment