Browse Source

Show whether muted users' notifications are muted in account lists

closed-social-glitch-2
Surinna Curtis 7 years ago
parent
commit
0e0703dbd8
1 changed files with 24 additions and 1 deletions
  1. +24
    -1
      app/javascript/mastodon/components/account.js

+ 24
- 1
app/javascript/mastodon/components/account.js View File

@ -14,6 +14,8 @@ const messages = defineMessages({
requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' },
unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },
unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },
mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' },
unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' },
});
@injectIntl
@ -41,6 +43,12 @@ export default class Account extends ImmutablePureComponent {
this.props.onMute(this.props.account);
}
handleMuteNotifications = () => {
}
handleUnmuteNotifications = () => {
}
render () {
const { account, me, intl, hidden } = this.props;
@ -70,7 +78,22 @@ export default class Account extends ImmutablePureComponent {
} else if (blocking) {
buttons = <IconButton active icon='unlock-alt' title={intl.formatMessage(messages.unblock, { name: account.get('username') })} onClick={this.handleBlock} />;
} else if (muting) {
buttons = <IconButton active icon='volume-up' title={intl.formatMessage(messages.unmute, { name: account.get('username') })} onClick={this.handleMute} />;
let hidingNotificationsButton;
if (muting.get('notifications')) {
hidingNotificationsButton = <IconButton active icon='bell' title={intl.formatMessage(messages.unmute_notifications, { name: account.get('username') })} onClick={this.handleUnmuteNotifications} />;
} else {
<<<<<<< HEAD
hidingNotificationsButton = <IconButton active icon='bell' title={intl.formatMessage(messages.mute_notifications, { name: account.get('username') })} onClick={this.handleMuteNotifications} />
=======
hidingNotificationsButton = <IconButton active icon='bell-slash' title={intl.formatMessage(messages.mute_notifications, { name: account.get('username') })} onClick={this.handleMuteNotifications} />;
>>>>>>> 917b2d5f... fixup swapped icons
}
buttons = (
<div>
<IconButton active icon='volume-up' title={intl.formatMessage(messages.unmute, { name: account.get('username') })} onClick={this.handleMute} />
{hidingNotificationsButton}
</div>
);
} else {
buttons = <IconButton icon={following ? 'user-times' : 'user-plus'} title={intl.formatMessage(following ? messages.unfollow : messages.follow)} onClick={this.handleFollow} active={following} />;
}

Loading…
Cancel
Save