CommentForm.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import FormControl from 'react-bootstrap/es/FormControl';
  4. import Button from 'react-bootstrap/es/Button';
  5. import UserPicture from '../User/UserPicture';
  6. /**
  7. *
  8. * @author Yuki Takei <yuki@weseek.co.jp>
  9. *
  10. * @export
  11. * @class Comment
  12. * @extends {React.Component}
  13. */
  14. export default class CommentForm extends React.Component {
  15. constructor(props) {
  16. super(props);
  17. this.state = {
  18. value: ''
  19. };
  20. }
  21. handleChange(e) {
  22. this.setState({ value: e.target.value });
  23. }
  24. render() {
  25. const creator = "yusuketk";
  26. const creatorsPage = `/user/${creator}`;
  27. return (
  28. <div className="comment-form">
  29. <div className="comment-form-user">
  30. <a href={creatorsPage}>
  31. <UserPicture />
  32. </a>
  33. </div>
  34. <div className="comment-form-main">
  35. <div className="comment-form-editor">
  36. <FormControl
  37. type="text"
  38. className="comment-form-comment form-control"
  39. value={this.state.value}
  40. required
  41. placeholder="Write comments here..."
  42. onChange={this.handleChange}
  43. />
  44. <div className="form-check">
  45. <input type="checkbox" className="form-check-input" id="checkbox-markdown"></input>
  46. <label className="form-check-label" htmlFor="checkbox-markdown">Markdown</label>
  47. </div>
  48. </div>
  49. <div className="comment-submit">
  50. <div className="pull-right">
  51. <Button bsStyle="primary" className="fcbtn btn btn-sm btn-primary btn-outline btn-rounded btn-1b">
  52. Comment
  53. </Button>
  54. </div>
  55. <div className="clearfix">
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. );
  61. }
  62. }
  63. CommentForm.propTypes = {
  64. };