Archived
2
0
Fork 0

Mute button progress so far. WIP, doesn't entirely work correctly.

This commit is contained in:
Kit Redgrave 2017-02-05 19:51:56 -06:00
parent 89fc2d7f48
commit 442fdbfc53
26 changed files with 390 additions and 33 deletions

View file

@ -16,6 +16,7 @@ const Header = React.createClass({
onBlock: React.PropTypes.func.isRequired,
onMention: React.PropTypes.func.isRequired,
onReport: React.PropTypes.func.isRequired
onMute: React.PropTypes.func.isRequired,
},
mixins: [PureRenderMixin],
@ -37,6 +38,10 @@ const Header = React.createClass({
this.context.router.push('/report');
},
handleMute() {
this.props.onMute(this.props.account);
},
render () {
const { account, me } = this.props;
@ -58,6 +63,7 @@ const Header = React.createClass({
onBlock={this.handleBlock}
onMention={this.handleMention}
onReport={this.handleReport}
onMute={this.handleMute}
/>
</div>
);

View file

@ -5,7 +5,9 @@ import {
followAccount,
unfollowAccount,
blockAccount,
unblockAccount
unblockAccount,
muteAccount,
unmuteAccount
} from '../../../actions/accounts';
import { mentionCompose } from '../../../actions/compose';
import { initReport } from '../../../actions/reports';
@ -44,6 +46,14 @@ const mapDispatchToProps = dispatch => ({
onReport (account) {
dispatch(initReport(account));
},
onMute (account) {
if (account.getIn(['relationship', 'muting'])) {
dispatch(unmuteAccount(account.get('id')));
} else {
dispatch(muteAccount(account.get('id')));
}
}
});