Guest User

Untitled

a guest
Mar 19th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. import React from 'react'
  2. import { css } from 'glamor'
  3.  
  4. class SignUp extends React.Component {
  5. state = {
  6. username: '',
  7. password: '',
  8. email: '',
  9. phone_number: '',
  10. authCode: ''
  11. }
  12. onChange = (key, value) => {
  13. this.setState({ [key]: value })
  14. }
  15. render() {
  16. return (
  17. <div {...css(styles.container)}>
  18. <h2>Sign Up</h2>
  19. <input
  20. {...css(styles.input)}
  21. placeholder='Username'
  22. onChange={evt => this.onChange('username', evt.target.value)}
  23. />
  24. <input
  25. {...css(styles.input)}
  26. placeholder='Password'
  27. type='password'
  28. onChange={evt => this.onChange('password', evt.target.value)}
  29. />
  30. <input
  31. {...css(styles.input)}
  32. placeholder='Email'
  33. onChange={evt => this.onChange('email', evt.target.value)}
  34. />
  35. <input
  36. {...css(styles.input)}
  37. placeholder='Phone Number'
  38. onChange={evt => this.onChange('phone_number', evt.target.value)}
  39. />
  40. <div {...css(styles.button)}>
  41. <span>Sign Up</span>
  42. </div>
  43.  
  44. <input
  45. {...css(styles.input)}
  46. placeholder='Authentication Code'
  47. onChange={evt => this.onChange('authCode', evt.target.value)}
  48. />
  49. <div {...css(styles.button)}>
  50. <span>Confirm Sign Up</span>
  51. </div>
  52.  
  53. </div>
  54. )
  55. }
  56. }
  57.  
  58. let styles = {
  59. container: {
  60. display: 'flex',
  61. flexDirection: 'column',
  62. alignItems: 'center'
  63. },
  64. button: {
  65. width: '170px',
  66. padding: '10px 0px',
  67. backgroundColor: '#ddd',
  68. cursor: 'pointer',
  69. borderRadius: '3px',
  70. ':hover': {
  71. backgroundColor: '#ededed'
  72. }
  73. },
  74. input: {
  75. height: 40,
  76. marginBottom: '10px',
  77. border: 'none',
  78. outline: 'none',
  79. borderBottom: '2px solid #4CAF50',
  80. fontSize: '16px',
  81. '::placeholder': {
  82. color: 'rgba(0, 0, 0, .3)'
  83. }
  84. }
  85. }
  86.  
  87. export default SignUp
Add Comment
Please, Sign In to add comment