CustomizeLayoutOptions.jsx 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. import CustomizeLayoutOption from './CustomizeLayoutOption';
  5. import { createSubscribedElement } from '../../UnstatedUtils';
  6. import AdminCustomizeContainer from '../../../services/AdminCustomizeContainer';
  7. import AppContainer from '../../../services/AppContainer';
  8. class CustomizeLayoutOptions extends React.Component {
  9. render() {
  10. const { adminCustomizeContainer } = this.props;
  11. return (
  12. <React.Fragment>
  13. <CustomizeLayoutOption
  14. layoutType="crowi-plus"
  15. isSelected={adminCustomizeContainer.state.currentLayout === 'growi'}
  16. onSelected={() => adminCustomizeContainer.switchLayoutType('growi')}
  17. labelHtml={'GROWI Enhanced Layout <small className="text-success">(Recommended)</small>'}
  18. >
  19. {/* TODO i18n */}
  20. <h4>Simple and Clear</h4>
  21. <ul>
  22. <li>Full screen layout and thin margins/paddings</li>
  23. <li>Show and post comments at the bottom of the page</li>
  24. <li>Affix Table-of-contents</li>
  25. </ul>
  26. </CustomizeLayoutOption>
  27. <CustomizeLayoutOption
  28. layoutType="kibela"
  29. isSelected={adminCustomizeContainer.state.currentLayout === 'kibela'}
  30. onSelected={() => adminCustomizeContainer.switchLayoutType('kibela')}
  31. labelHtml="Kibela Like Layout"
  32. >
  33. {/* TODO i18n */}
  34. <h4>Easy Viewing Structure</h4>
  35. <ul>
  36. <li>Center aligned contents</li>
  37. <li>Show and post comments at the bottom of the page</li>
  38. <li>Affix Table-of-contents</li>
  39. </ul>
  40. </CustomizeLayoutOption>
  41. <CustomizeLayoutOption
  42. layoutType="classic"
  43. isSelected={adminCustomizeContainer.state.currentLayout === 'crowi'}
  44. onSelected={() => adminCustomizeContainer.switchLayoutType('crowi')}
  45. labelHtml="Crowi Classic Layout"
  46. >
  47. {/* TODO i18n */}
  48. <h4>Separated Functions</h4>
  49. <ul>
  50. <li>Collapsible Sidebar</li>
  51. <li>Show and post comments in Sidebar</li>
  52. <li>Collapsible Table-of-contents</li>
  53. </ul>
  54. </CustomizeLayoutOption>
  55. </React.Fragment>
  56. );
  57. }
  58. }
  59. const CustomizeLayoutOptionsWrapper = (props) => {
  60. return createSubscribedElement(CustomizeLayoutOptions, props, [AppContainer, AdminCustomizeContainer]);
  61. };
  62. CustomizeLayoutOptions.propTypes = {
  63. t: PropTypes.func.isRequired, // i18next
  64. appContainer: PropTypes.instanceOf(AppContainer).isRequired,
  65. adminCustomizeContainer: PropTypes.instanceOf(AdminCustomizeContainer).isRequired,
  66. };
  67. export default withTranslation()(CustomizeLayoutOptionsWrapper);