From 455a0348020f392bdabc82f339acde48a0010009 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Thu, 22 Jun 2017 22:13:09 +0700 Subject: [PATCH] Don't show dropdown on current logged in user --- .../routes/Community/components/Community.js | 1 + .../Community/components/FlaggedAccounts.js | 1 + .../src/routes/Community/components/User.js | 24 ++++++++++--------- .../routes/Community/containers/Community.js | 3 ++- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/client/coral-admin/src/routes/Community/components/Community.js b/client/coral-admin/src/routes/Community/components/Community.js index fe7478efb..e87e7ac54 100644 --- a/client/coral-admin/src/routes/Community/components/Community.js +++ b/client/coral-admin/src/routes/Community/components/Community.js @@ -83,6 +83,7 @@ export default class Community extends Component { showRejectUsernameDialog={props.showRejectUsernameDialog} approveUser={props.approveUser} rejectUsername={props.rejectUsername} + currentUser={this.props.currentUser} /> { showSuspendUserDialog={props.showSuspendUserDialog} showRejectUsernameDialog={props.showRejectUsernameDialog} approveUser={props.approveUser} + currentUser={props.currentUser} />; }) : {t('community.no_flagged_accounts')} diff --git a/client/coral-admin/src/routes/Community/components/User.js b/client/coral-admin/src/routes/Community/components/User.js index 639888e7d..ee917e295 100644 --- a/client/coral-admin/src/routes/Community/components/User.js +++ b/client/coral-admin/src/routes/Community/components/User.js @@ -40,17 +40,19 @@ const User = (props) => { {user.username} - - - Suspend User - - Ban User - - + {props.currentUser.id !== user.id && + + + Suspend User + + Ban User + + + } diff --git a/client/coral-admin/src/routes/Community/containers/Community.js b/client/coral-admin/src/routes/Community/containers/Community.js index 2ef0d9eb3..ee2f874a8 100644 --- a/client/coral-admin/src/routes/Community/containers/Community.js +++ b/client/coral-admin/src/routes/Community/containers/Community.js @@ -86,7 +86,8 @@ export const withCommunityQuery = withQuery(gql` }); const mapStateToProps = (state) => ({ - community: state.community.toJS() + community: state.community.toJS(), + currentUser: state.auth.toJS().user, }); const mapDispatchToProps = (dispatch) =>