CustomizeThemeForm.jsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 AdminCustomizeContainer from '../../../services/AdminCustomizeContainer';
  7. import ThemeColorBox from './ThemeColorBox';
  8. class CustomizeThemeForm extends React.Component {
  9. render() {
  10. return (
  11. <div id="themeOptions" className={`${this.props.adminCustomizeContainer.state.layoutType === 'kibela' && 'disabled'}`}>
  12. {/* Light Themes */}
  13. <div className="d-flex">
  14. <ThemeColorBox name="default" bg="#ffffff" topbar="#334455" theme="#112744" />
  15. <ThemeColorBox name="nature" bg="#f9fff3" topbar="#118050" theme="#460039" />
  16. <ThemeColorBox name="mono-blue" bg="#F7FBFD" topbar="#00587A" theme="#00587A" />
  17. <ThemeColorBox name="wood" bg="#fffefb" topbar="#aaa45f" theme="#dddebf" />
  18. <ThemeColorBox name="island" bg="#8ecac0" topbar="#0c2a44" theme="#cef2ef" />
  19. <ThemeColorBox name="christmas" bg="#fffefb" topbar="#b3000c" theme="#017e20" />
  20. <ThemeColorBox name="antarctic" bg="#ffffff" topbar="#000080" theme="#99cccc" />
  21. </div>
  22. {/* Dark Themes */}
  23. <div className="d-flex mt-3">
  24. <ThemeColorBox name="default-dark" bg="#212731" topbar="#151515" theme="#f75b36" />
  25. <ThemeColorBox name="future" bg="#16282D" topbar="#011414" theme="#04B4AE" />
  26. <ThemeColorBox name="blue-night" bg="#061F2F" topbar="#27343B" theme="#0090C8" />
  27. <ThemeColorBox name="halloween" bg="#030003" topbar="#cc5d1f" theme="#e9af2b" />
  28. </div>
  29. </div>
  30. );
  31. }
  32. }
  33. const CustomizeThemeFormWrapper = (props) => {
  34. return createSubscribedElement(CustomizeThemeForm, props, [AppContainer, AdminCustomizeContainer]);
  35. };
  36. CustomizeThemeForm.propTypes = {
  37. t: PropTypes.func.isRequired, // i18next
  38. appContainer: PropTypes.instanceOf(AppContainer).isRequired,
  39. adminCustomizeContainer: PropTypes.instanceOf(AdminCustomizeContainer).isRequired,
  40. };
  41. export default withTranslation()(CustomizeThemeFormWrapper);