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 GrantPermissionButton from './grant_permission_button'; import SettingToggle from './setting_toggle'; import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_REPORTS } from 'mastodon/permissions'; export default class ColumnSettings extends React.PureComponent { static contextTypes = { identity: PropTypes.object, }; static propTypes = { settings: ImmutablePropTypes.map.isRequired, pushSettings: ImmutablePropTypes.map.isRequired, onChange: PropTypes.func.isRequired, onClear: PropTypes.func.isRequired, onRequestNotificationPermission: PropTypes.func, alertsEnabled: PropTypes.bool, browserSupport: PropTypes.bool, browserPermission: PropTypes.bool, }; onPushChange = (path, checked) => { this.props.onChange(['push', ...path], checked); } render () { const { settings, pushSettings, onChange, onClear, alertsEnabled, browserSupport, browserPermission, onRequestNotificationPermission } = this.props; const unreadMarkersShowStr = ; const filterBarShowStr = ; const filterAdvancedStr = ; const alertStr = ; const showStr = ; const soundStr = ; const showPushSettings = pushSettings.get('browserSupport') && pushSettings.get('isSubscribed'); const pushStr = showPushSettings && ; return (
{alertsEnabled && browserSupport && browserPermission === 'denied' && (
)} {alertsEnabled && browserSupport && browserPermission === 'default' && (
)}
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{showPushSettings && }
{((this.context.identity.permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS) && (
{showPushSettings && }
)} {((this.context.identity.permissions & PERMISSION_MANAGE_REPORTS) === PERMISSION_MANAGE_REPORTS) && (
{showPushSettings && }
)}
); } }