import PropTypes from 'prop-types'; import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { injectIntl, defineMessages, FormattedMessage } from 'react-intl'; import IconButton from 'soapbox/components/icon_button'; import ClearColumnButton from './clear_column_button'; import MultiSettingToggle from './multi_setting_toggle'; import SettingToggle from './setting_toggle'; const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, }); class ColumnSettings extends React.PureComponent { static propTypes = { intl: PropTypes.object.isRequired, settings: ImmutablePropTypes.map.isRequired, pushSettings: ImmutablePropTypes.map.isRequired, onChange: PropTypes.func.isRequired, onClear: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, supportsEmojiReacts: PropTypes.bool, supportsBirthdays: 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 { intl, settings, pushSettings, onChange, onClear, onClose, supportsEmojiReacts, supportsBirthdays } = 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 && ; const birthdaysStr = ; return (

{supportsBirthdays &&
}
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{supportsEmojiReacts &&
{showPushSettings && }
}
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
); } } export default injectIntl(ColumnSettings);