[Glitch] Add UI for enabling/disabling poll notifications

pull/958/head
ThibG 2019-03-13 19:29:54 +01:00 committed by Thibaut Girka
parent 5ffdc5426e
commit 931ecc8824
4 changed files with 21 additions and 1 deletions

View File

@ -66,7 +66,7 @@ export default class StatusPrepend extends React.PureComponent {
return ( return (
<FormattedMessage <FormattedMessage
id='notification.poll' id='notification.poll'
defaultMessage='Your poll has ended' defaultMessage='A poll you have voted in has ended'
/> />
); );
} }

View File

@ -90,6 +90,17 @@ export default class ColumnSettings extends React.PureComponent {
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'reblog']} onChange={onChange} label={soundStr} /> <SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'reblog']} onChange={onChange} label={soundStr} />
</div> </div>
</div> </div>
<div role='group' aria-labelledby='notifications-poll'>
<span id='notifications-poll' className='column-settings__section'><FormattedMessage id='notifications.column_settings.poll' defaultMessage='Poll results:' /></span>
<div className='column-settings__row'>
<SettingToggle prefix='notifications_desktop' settings={settings} settingPath={['alerts', 'poll']} onChange={onChange} label={alertStr} />
{showPushSettings && <SettingToggle prefix='notifications_push' settings={pushSettings} settingPath={['alerts', 'poll']} meta={pushMeta} onChange={this.onPushChange} label={pushStr} />}
<SettingToggle prefix='notifications' settings={settings} settingPath={['shows', 'poll']} onChange={onChange} label={showStr} />
<SettingToggle prefix='notifications' settings={settings} settingPath={['sounds', 'poll']} onChange={onChange} label={soundStr} />
</div>
</div>
</div> </div>
); );
} }

View File

@ -6,6 +6,7 @@ const tooltips = defineMessages({
mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' }, mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' },
favourites: { id: 'notifications.filter.favourites', defaultMessage: 'Favourites' }, favourites: { id: 'notifications.filter.favourites', defaultMessage: 'Favourites' },
boosts: { id: 'notifications.filter.boosts', defaultMessage: 'Boosts' }, boosts: { id: 'notifications.filter.boosts', defaultMessage: 'Boosts' },
polls: { id: 'notifications.filter.polls', defaultMessage: 'Poll results' },
follows: { id: 'notifications.filter.follows', defaultMessage: 'Follows' }, follows: { id: 'notifications.filter.follows', defaultMessage: 'Follows' },
}); });
@ -78,6 +79,13 @@ class FilterBar extends React.PureComponent {
> >
<i className='fa fa-fw fa-retweet' /> <i className='fa fa-fw fa-retweet' />
</button> </button>
<button
className={selectedFilter === 'poll' ? 'active' : ''}
onClick={this.onClick('poll')}
title={intl.formatMessage(tooltips.polls)}
>
<i className='fa fa-fw fa-tasks' />
</button>
<button <button
className={selectedFilter === 'follow' ? 'active' : ''} className={selectedFilter === 'follow' ? 'active' : ''}
onClick={this.onClick('follow')} onClick={this.onClick('follow')}

View File

@ -9,6 +9,7 @@ const initialState = Immutable.Map({
favourite: false, favourite: false,
reblog: false, reblog: false,
mention: false, mention: false,
poll: false,
}), }),
isSubscribed: false, isSubscribed: false,
browserSupport: false, browserSupport: false,