Prompt.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import React from "react";
  2. const PropTypes = React.PropTypes;
  3. const transparentBg = require("../styles/index").transparentBg;
  4. const Prompt = (props) => (
  5. <div className="jumbotron col-sm-6 col-sm-offset-3 text-center"
  6. style={transparentBg}>
  7. <h1>{props.header}</h1>
  8. <div className="col-sm-12">
  9. <form onSubmit={props.onSubmitUser}>
  10. <div className="form-group">
  11. <input
  12. className="form-control"
  13. onChange={props.onUpdateUser}
  14. placeholder="Github username"
  15. type="text"
  16. value={props.username}
  17. />
  18. </div>
  19. <div className="form-group col-sm-4 col-sm-offset-4">
  20. <button type="submit" className="btn btn-block btn-success">
  21. Continue
  22. </button>
  23. </div>
  24. </form>
  25. </div>
  26. </div>
  27. );
  28. Prompt.propTypes = {
  29. header: PropTypes.string.isRequired,
  30. onSubmitUser: PropTypes.func.isRequired,
  31. onUpdateUser: PropTypes.func.isRequired,
  32. username: PropTypes.string.isRequired
  33. };
  34. export default Prompt;