Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. constructor(props)
  2. {
  3. super(props);
  4. this.state = {
  5. email: '',
  6. first_name: '',
  7. middle_name: '',
  8. country: '',
  9. country_code: '',
  10. mobile_number: '',
  11. gender: ''
  12. }
  13. }
  14.  
  15. componentDidMount()
  16. {
  17. store.dispatch(getUserProfile())
  18. .then(() => {
  19. const user = this.props.userProfile.userProfile && this.props.userProfile.userProfile.data.data;
  20. this.setState({
  21. email: user.email,
  22. first_name: user.first_name
  23. });
  24.  
  25. })
  26. }
  27.  
  28. render()
  29. {
  30. return (
  31. <div className="form-group col-sm-12">
  32. <label htmlFor="email">Email*</label>
  33. <input type="email" name="email" value={this.state.email || ''}/>
  34. </div>
  35.  
  36. <div className="form-group col-sm-12">
  37. <label htmlFor="email">First Name*</label>
  38. <input type="email" name="email" value={this.state.first_name || ''}/>
  39. </div>
  40. )
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement