import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { FormattedMessage } from 'react-intl'; import ClearColumnButton from './clear_column_button'; import SettingToggle from './setting_toggle'; import MultiSettingToggle from './multi_setting_toggle'; export default class ColumnSettings extends React.PureComponent { static propTypes = { settings: ImmutablePropTypes.map.isRequired, pushSettings: ImmutablePropTypes.map.isRequired, onChange: PropTypes.func.isRequired, onClear: PropTypes.func.isRequired, supportsEmojiReacts: PropTypes.bool, }; onPushChange = (path, checked) => { this.props.onChange(['push', ...path], checked); } onAllSoundsChange = (path, checked) => { const soundSettings = [['sounds', 'follow'], ['sounds', 'favourite'], ['sounds', 'pleroma:emoji_reaction'], ['sounds', 'mention'], ['sounds', 'reblog'], ['sounds', 'poll'], ['sounds', 'move']]; for (let i = 0; i < soundSettings.length; i++) { this.props.onChange(soundSettings[i], checked); } } render() { const { settings, pushSettings, onChange, onClear, supportsEmojiReacts } = this.props; const filterShowStr = ; const filterAdvancedStr = ; const alertStr = ; const allSoundsStr = ; const showStr = ; const soundStr = ; const soundSettings = [['sounds', 'follow'], ['sounds', 'favourite'], ['sounds', 'pleroma:emoji_reaction'], ['sounds', 'mention'], ['sounds', 'reblog'], ['sounds', 'poll'], ['sounds', 'move']]; const showPushSettings = pushSettings.get('browserSupport') && pushSettings.get('isSubscribed'); const pushStr = showPushSettings && ; return (
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{supportsEmojiReacts &&
{showPushSettings && }
}
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
); } }