MarkDownSetting.jsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. import { createSubscribedElement } from '../../UnstatedUtils';
  5. import AppContainer from '../../../services/AppContainer';
  6. import LineBreakForm from './LineBreakForm';
  7. import PresentationForm from './PresentationForm';
  8. import XssForm from './XssForm';
  9. class MarkdownSetting extends React.Component {
  10. render() {
  11. const { t } = this.props;
  12. return (
  13. <React.Fragment>
  14. {/* Line Break Setting */}
  15. <div className="row mb-5">
  16. <h2 className="border-bottom">{ t('markdown_setting.line_break_setting') }</h2>
  17. <p className="well">{ t('markdown_setting.line_break_setting_desc') }</p>
  18. <LineBreakForm />
  19. </div>
  20. {/* Presentation Setting */}
  21. <div className="row mb-5">
  22. <h2 className="border-bottom">{ t('markdown_setting.presentation_setting') }</h2>
  23. <p className="well">{ t('markdown_setting.presentation_setting_desc') }</p>
  24. <PresentationForm />
  25. </div>
  26. {/* XSS Setting */}
  27. <div className="row mb-5">
  28. <h2 className="border-bottom">{ t('markdown_setting.XSS_setting') }</h2>
  29. <p className="well">{ t('markdown_setting.XSS_setting_desc') }</p>
  30. <XssForm />
  31. </div>
  32. </React.Fragment>
  33. );
  34. }
  35. }
  36. const MarkdownSettingWrapper = (props) => {
  37. return createSubscribedElement(MarkdownSetting, props, [AppContainer]);
  38. };
  39. MarkdownSetting.propTypes = {
  40. t: PropTypes.func.isRequired, // i18next
  41. appContainer: PropTypes.instanceOf(AppContainer).isRequired,
  42. };
  43. export default withTranslation()(MarkdownSettingWrapper);