The code powering m.abunchtell.com https://m.abunchtell.com
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

33 řádky
851 B

  1. import ImmutablePropTypes from 'react-immutable-proptypes';
  2. import Toggle from 'react-toggle';
  3. const labelStyle = {
  4. display: 'block',
  5. lineHeight: '24px',
  6. verticalAlign: 'middle'
  7. };
  8. const labelSpanStyle = {
  9. display: 'inline-block',
  10. verticalAlign: 'middle',
  11. marginBottom: '14px',
  12. marginLeft: '8px',
  13. color: '#9baec8'
  14. };
  15. const SettingToggle = ({ settings, settingKey, label, onChange }) => (
  16. <label style={labelStyle}>
  17. <Toggle checked={settings.getIn(settingKey)} onChange={(e) => onChange(settingKey, e.target.checked)} />
  18. <span style={labelSpanStyle}>{label}</span>
  19. </label>
  20. );
  21. SettingToggle.propTypes = {
  22. settings: ImmutablePropTypes.map.isRequired,
  23. settingKey: React.PropTypes.array.isRequired,
  24. label: React.PropTypes.node.isRequired,
  25. onChange: React.PropTypes.func.isRequired
  26. };
  27. export default SettingToggle;