CustomizeLayoutOption.jsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. class CustomizeLayoutOption extends React.Component {
  5. render() {
  6. return (
  7. <div className="col-sm-4">
  8. <h4>
  9. <div className="radio radio-primary">
  10. <input type="radio" id={`radio-layout-${this.props.layoutType}`} checked={this.props.isSelected} onChange={this.props.onSelected} />
  11. <label htmlFor={`radio-layout-${this.props.layoutType}`}>
  12. {/* eslint-disable-next-line react/no-danger */}
  13. <span dangerouslySetInnerHTML={{ __html: this.props.labelHtml }} />
  14. </label>
  15. </div>
  16. </h4>
  17. <a href={`/images/admin/customize/layout-${this.props.layoutType}.gif`} className="ss-container">
  18. <img src={`/images/admin/customize/layout-${this.props.layoutType}-thumb.gif`} width="240px" />
  19. </a>
  20. {/* render layout description */}
  21. {this.props.children}
  22. </div>
  23. );
  24. }
  25. }
  26. CustomizeLayoutOption.propTypes = {
  27. t: PropTypes.func.isRequired, // i18next
  28. layoutType: PropTypes.string.isRequired,
  29. labelHtml: PropTypes.string.isRequired,
  30. isSelected: PropTypes.bool.isRequired,
  31. onSelected: PropTypes.func.isRequired,
  32. children: PropTypes.array.isRequired,
  33. };
  34. export default withTranslation()(CustomizeLayoutOption);