CommentPreview.jsx 685 B

12345678910111213141516171819202122232425262728293031323334
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import RevisionBody from '../Page/RevisionBody';
  4. /**
  5. * Wrapper component for Page/RevisionBody
  6. */
  7. export default class CommentPreview extends React.Component {
  8. render() {
  9. return (
  10. <div
  11. className="page-comment-preview-body"
  12. ref={(elm) => {
  13. this.previewElement = elm;
  14. this.props.inputRef(elm);
  15. }}
  16. >
  17. <RevisionBody
  18. {...this.props}
  19. additionalClassName="comment"
  20. />
  21. </div>
  22. );
  23. }
  24. }
  25. CommentPreview.propTypes = {
  26. html: PropTypes.string,
  27. inputRef: PropTypes.func.isRequired, // for getting div element
  28. };