Show notification on success

This commit is contained in:
Chi Vinh Le
2017-09-04 23:55:44 +07:00
parent f8297e9652
commit 2d4adb60be
5 changed files with 14 additions and 8 deletions
@@ -4,11 +4,14 @@ import {compose, gql} from 'react-apollo';
import {connect, withFragments, withIgnoreUser} from 'plugin-api/beta/client/hocs';
import {bindActionCreators} from 'redux';
import {closeMenu} from 'plugins/talk-plugin-author-menu/client/actions';
import {notify} from 'plugin-api/beta/client/actions/notification';
import {t} from 'plugin-api/beta/client/services';
class IgnoreUserConfirmationContainer extends React.Component {
ignoreUser = () => {
this.props.ignoreUser(this.props.comment.user.id);
this.props.notify('success', t('talk-plugin-ignore-user.notify_success', this.props.comment.user.username));
this.props.closeMenu();
};
@@ -28,6 +31,7 @@ class IgnoreUserConfirmationContainer extends React.Component {
const mapDispatchToProps = (dispatch) =>
bindActionCreators({
closeMenu,
notify,
}, dispatch);
const withIgnoreUserConfirmationFragments = withFragments({
@@ -5,5 +5,7 @@ en:
confirmation: |
When you ignore a user, all comments they wrote on the site will be hidden from you. You can
undo this later from My Profile.
notify_success: |
You are now ignoring {0}. You can undo this action from My Profile.
es:
talk-plugin-ignore-user: