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 Icon from 'flavours/glitch/components/icon'; 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, onRequestNotificationPermission: PropTypes.func.isRequired, alertsEnabled: PropTypes.bool, browserSupport: PropTypes.bool, browserPermission: PropTypes.bool, }; onPushChange = (path, checked) => { this.props.onChange(['push', ...path], checked); } render () { const { settings, pushSettings, onChange, onClear, onRequestNotificationPermission, alertsEnabled, browserSupport, browserPermission } = this.props; const filterShowStr = ; const filterAdvancedStr = ; const alertStr = ; const showStr = ; const soundStr = ; const showPushSettings = pushSettings.get('browserSupport') && pushSettings.get('isSubscribed'); const pushStr = showPushSettings && ; const pushMeta = showPushSettings && ; const settingsIssues = []; if (alertsEnabled && browserSupport && browserPermission !== 'granted') { if (browserPermission === 'denied') { settingsIssues.push( ); } else if (browserPermission === 'default') { settingsIssues.push( ); } } return (
{settingsIssues && (
{settingsIssues}
)}
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
); } }