diff options
author | beatrix <beatrix.bitrot@gmail.com> | 2017-12-26 17:03:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-26 17:03:00 -0500 |
commit | e6ab869d956eb088eff6ce8b8b6114fb0d6d63fd (patch) | |
tree | 0ddfc8cb254dbc17fe9628166c2d57e793c83e8d /app/javascript/flavours/glitch/features/status/components | |
parent | 6b85dba8daf7ddb59063cadfe4e2a6dc071931d5 (diff) | |
parent | cc6a2ffd0a23432dd64f9b0188dea12b79889c79 (diff) |
Merge pull request #285 from chriswmartin/detailed-status-actions
Add mute, block, conversation mute actions to detailed status dropdown
Diffstat (limited to 'app/javascript/flavours/glitch/features/status/components')
-rw-r--r-- | app/javascript/flavours/glitch/features/status/components/action_bar.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/status/components/action_bar.js b/app/javascript/flavours/glitch/features/status/components/action_bar.js index 3190fd0be..573c3743f 100644 --- a/app/javascript/flavours/glitch/features/status/components/action_bar.js +++ b/app/javascript/flavours/glitch/features/status/components/action_bar.js @@ -13,6 +13,10 @@ const messages = defineMessages({ reblog: { id: 'status.reblog', defaultMessage: 'Boost' }, cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' }, favourite: { id: 'status.favourite', defaultMessage: 'Favourite' }, + mute: { id: 'status.mute', defaultMessage: 'Mute @{name}' }, + muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' }, + unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' }, + block: { id: 'status.block', defaultMessage: 'Block @{name}' }, report: { id: 'status.report', defaultMessage: 'Report @{name}' }, share: { id: 'status.share', defaultMessage: 'Share' }, pin: { id: 'status.pin', defaultMessage: 'Pin on profile' }, @@ -32,6 +36,9 @@ export default class ActionBar extends React.PureComponent { onReply: PropTypes.func.isRequired, onReblog: PropTypes.func.isRequired, onFavourite: PropTypes.func.isRequired, + onMute: PropTypes.func, + onMuteConversation: PropTypes.func, + onBlock: PropTypes.func, onDelete: PropTypes.func.isRequired, onMention: PropTypes.func.isRequired, onReport: PropTypes.func, @@ -60,6 +67,18 @@ export default class ActionBar extends React.PureComponent { this.props.onMention(this.props.status.get('account'), this.context.router.history); } + handleMuteClick = () => { + this.props.onMute(this.props.status.get('account')); + } + + handleConversationMuteClick = () => { + this.props.onMuteConversation(this.props.status); + } + + handleBlockClick = () => { + this.props.onBlock(this.props.status.get('account')); + } + handleReport = () => { this.props.onReport(this.props.status); } @@ -83,6 +102,7 @@ export default class ActionBar extends React.PureComponent { const { status, intl } = this.props; const publicStatus = ['public', 'unlisted'].includes(status.get('visibility')); + const mutingConversation = status.get('muted'); let menu = []; @@ -95,10 +115,15 @@ export default class ActionBar extends React.PureComponent { menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick }); } + menu.push(null); + menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick }); + menu.push(null); menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick }); } else { menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick }); menu.push(null); + menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick }); + menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick }); menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport }); } |