CommentForm.js 1.3 KB

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