logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

column_settings.js (1994B)


  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import ImmutablePropTypes from 'react-immutable-proptypes';
  4. import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
  5. import SettingToggle from '../../notifications/components/setting_toggle';
  6. import SettingText from '../../../components/setting_text';
  7. const messages = defineMessages({
  8. filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },
  9. settings: { id: 'home.settings', defaultMessage: 'Column settings' },
  10. });
  11. @injectIntl
  12. export default class ColumnSettings extends React.PureComponent {
  13. static propTypes = {
  14. settings: ImmutablePropTypes.map.isRequired,
  15. onChange: PropTypes.func.isRequired,
  16. intl: PropTypes.object.isRequired,
  17. };
  18. render () {
  19. const { settings, onChange, intl } = this.props;
  20. return (
  21. <div>
  22. <span className='column-settings__section'><FormattedMessage id='home.column_settings.basic' defaultMessage='Basic' /></span>
  23. <div className='column-settings__row'>
  24. <SettingToggle prefix='home_timeline' settings={settings} settingPath={['shows', 'reblog']} onChange={onChange} label={<FormattedMessage id='home.column_settings.show_reblogs' defaultMessage='Show boosts' />} />
  25. </div>
  26. <div className='column-settings__row'>
  27. <SettingToggle prefix='home_timeline' settings={settings} settingPath={['shows', 'reply']} onChange={onChange} label={<FormattedMessage id='home.column_settings.show_replies' defaultMessage='Show replies' />} />
  28. </div>
  29. <span className='column-settings__section'><FormattedMessage id='home.column_settings.advanced' defaultMessage='Advanced' /></span>
  30. <div className='column-settings__row'>
  31. <SettingText prefix='home_timeline' settings={settings} settingKey={['regex', 'body']} onChange={onChange} label={intl.formatMessage(messages.filter_regex)} />
  32. </div>
  33. </div>
  34. );
  35. }
  36. }