The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

78 regels
2.9 KiB

  1. import PureRenderMixin from 'react-addons-pure-render-mixin';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. import { FormattedMessage } from 'react-intl';
  4. import ColumnCollapsable from '../../../components/column_collapsable';
  5. import SettingToggle from './setting_toggle';
  6. const outerStyle = {
  7. background: '#373b4a',
  8. padding: '15px'
  9. };
  10. const sectionStyle = {
  11. cursor: 'default',
  12. display: 'block',
  13. fontWeight: '500',
  14. color: '#9baec8',
  15. marginBottom: '10px'
  16. };
  17. const rowStyle = {
  18. };
  19. const ColumnSettings = React.createClass({
  20. propTypes: {
  21. settings: ImmutablePropTypes.map.isRequired,
  22. onChange: React.PropTypes.func.isRequired,
  23. onSave: React.PropTypes.func.isRequired
  24. },
  25. mixins: [PureRenderMixin],
  26. render () {
  27. const { settings, onChange, onSave } = this.props;
  28. const alertStr = <FormattedMessage id='notifications.column_settings.alert' defaultMessage='Desktop notifications' />;
  29. const showStr = <FormattedMessage id='notifications.column_settings.show' defaultMessage='Show in column' />;
  30. return (
  31. <ColumnCollapsable icon='sliders' fullHeight={458} onCollapse={onSave}>
  32. <div style={outerStyle}>
  33. <span style={sectionStyle}><FormattedMessage id='notifications.column_settings.follow' defaultMessage='New followers:' /></span>
  34. <div style={rowStyle}>
  35. <SettingToggle settings={settings} settingKey={['alerts', 'follow']} onChange={onChange} label={alertStr} />
  36. <SettingToggle settings={settings} settingKey={['shows', 'follow']} onChange={onChange} label={showStr} />
  37. </div>
  38. <span style={sectionStyle}><FormattedMessage id='notifications.column_settings.favourite' defaultMessage='Favourites:' /></span>
  39. <div style={rowStyle}>
  40. <SettingToggle settings={settings} settingKey={['alerts', 'favourite']} onChange={onChange} label={alertStr} />
  41. <SettingToggle settings={settings} settingKey={['shows', 'favourite']} onChange={onChange} label={showStr} />
  42. </div>
  43. <span style={sectionStyle}><FormattedMessage id='notifications.column_settings.mention' defaultMessage='Mentions:' /></span>
  44. <div style={rowStyle}>
  45. <SettingToggle settings={settings} settingKey={['alerts', 'mention']} onChange={onChange} label={alertStr} />
  46. <SettingToggle settings={settings} settingKey={['shows', 'mention']} onChange={onChange} label={showStr} />
  47. </div>
  48. <span style={sectionStyle}><FormattedMessage id='notifications.column_settings.reblog' defaultMessage='Boosts:' /></span>
  49. <div style={rowStyle}>
  50. <SettingToggle settings={settings} settingKey={['alerts', 'reblog']} onChange={onChange} label={alertStr} />
  51. <SettingToggle settings={settings} settingKey={['shows', 'reblog']} onChange={onChange} label={showStr} />
  52. </div>
  53. </div>
  54. </ColumnCollapsable>
  55. );
  56. }
  57. });
  58. export default ColumnSettings;