CommentPreview.js 718 B

1234567891011121314151617181920212223242526272829303132333435
  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. constructor(props) {
  9. super(props);
  10. }
  11. render() {
  12. return (
  13. <div className="page-comment-preview-body"
  14. ref={(elm) => {
  15. this.previewElement = elm;
  16. this.props.inputRef(elm);
  17. }}>
  18. <RevisionBody
  19. {...this.props}
  20. additionalClassName="comment"
  21. />
  22. </div>
  23. );
  24. }
  25. }
  26. CommentPreview.propTypes = {
  27. html: PropTypes.string,
  28. inputRef: PropTypes.func.isRequired, // for getting div element
  29. };