Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. MeteorLogin = React.createClass({
  2. onChangePassword: function(value){
  3. e.preventDefault();
  4. console.log(value.target.value);
  5. },
  6. onChangeUsername: function(value){
  7. e.preventDefault();
  8. console.log(value.target.value);
  9. },
  10. render: function(){
  11. return (
  12. <div className="row" style={row}>
  13. <div style={contentStyle} className="col-sm-4 col-sm-offset-4">
  14. <h1>Login</h1>
  15. <hr style={rule}/>
  16. <form>
  17. <MeteorLogin.UserInput onChange={this.onChangePassword} ref="userInput"/>
  18. <MeteorLogin.PasswordInput onChange={this.onChangeUsername} ref="passwordInput"/>
  19. <MeteorLogin.LoginButton clickLogin={this.clickLogin}/>
  20. </form>
  21. </div>
  22. </div>
  23. )
  24. }
  25. });
  26.  
  27. MeteorLogin.UserInput = React.createClass({
  28. onChange: function(){
  29. e.preventDefault();
  30. this.props.onChange(e.target.value);
  31. },
  32. getInitialState: function() {
  33. return {
  34. value: ""
  35. }
  36. },
  37. render: function(){
  38. return (
  39. <div className="form-group">
  40. <label>User</label>
  41. <input onChange={this.props.onChange} className="form-control"/>
  42. </div>
  43. )
  44. }
  45. });
  46.  
  47. MeteorLogin.PasswordInput = React.createClass({
  48. getInitialState: function() {
  49. return {
  50. value: ""
  51. }
  52. },
  53. render: function(){
  54. return (
  55. <div className="form-group">
  56. <label>Password</label>
  57. <input onChange={this.props.onChange} type="password" className="form-control"/>
  58. </div>
  59. )
  60. }
  61. });
  62.  
  63. MeteorLogin.LoginButton = React.createClass({
  64. render: function(){
  65. return (
  66. <button onClick={this.props.clickLogin} className="btn btn-default">Login</button>
  67. )
  68. }
  69. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement