Naming conventions

This commit is contained in:
okbel
2018-01-04 11:49:10 -03:00
parent 3ca3b59802
commit 8c5040d88b
5 changed files with 23 additions and 22 deletions
@@ -119,10 +119,11 @@ class UserDetail extends React.Component {
viewUserDetail,
loadMore,
toggleSelectAll,
unBanUser,
unSuspendUser,
unbanUser,
unsuspendUser,
} = this.props;
// if totalComments is 0, you're dividing by zero
let rejectedPercent = (rejectedComments / totalComments) * 100;
if (rejectedPercent === Infinity || isNaN(rejectedPercent)) {
@@ -150,7 +151,7 @@ class UserDetail extends React.Component {
label={this.getActionMenuLabel()}>
{suspended ? <ActionsMenuItem
onClick={() => unSuspendUser({id: user.id})}>
onClick={() => unsuspendUser({id: user.id})}>
Remove Suspension
</ActionsMenuItem> : <ActionsMenuItem
disabled={me.id === user.id}
@@ -159,7 +160,7 @@ class UserDetail extends React.Component {
</ActionsMenuItem>}
{banned ? <ActionsMenuItem
onClick={() => unBanUser({id: user.id})}>
onClick={() => unbanUser({id: user.id})}>
Remove Ban
</ActionsMenuItem> : <ActionsMenuItem
disabled={me.id === user.id}
@@ -344,8 +345,8 @@ UserDetail.propTypes = {
notify: PropTypes.func.isRequired,
showSuspendUserDialog: PropTypes.func,
showBanUserDialog: PropTypes.func,
unBanUser: PropTypes.func.isRequired,
unSuspendUser: PropTypes.func.isRequired,
unbanUser: PropTypes.func.isRequired,
unsuspendUser: PropTypes.func.isRequired,
};
export default UserDetail;
@@ -137,8 +137,8 @@ UserDetailContainer.propTypes = {
setCommentStatus: PropTypes.func,
clearUserDetailSelections: PropTypes.func,
selectedCommentIds: PropTypes.array,
unBanUser: PropTypes.func.isRequired,
unSuspendUser: PropTypes.func.isRequired,
unbanUser: PropTypes.func.isRequired,
unsuspendUser: PropTypes.func.isRequired,
};
const LOAD_MORE_QUERY = gql`
@@ -41,12 +41,12 @@ class People extends React.Component {
return '';
};
unSuspendUser = (input) => {
this.props.unSuspendUser(input);
unsuspendUser = (input) => {
this.props.unsuspendUser(input);
}
unBanUser = (input) => {
this.props.unBanUser(input);
unbanUser = (input) => {
this.props.unbanUser(input);
}
showBanUserDialog = (input) => {
@@ -122,7 +122,7 @@ class People extends React.Component {
label={this.getActionMenuLabel(user)} >
{isSuspended(user) ? <ActionsMenuItem
onClick={() => this.unSuspendUser({id: user.id})}>
onClick={() => this.unsuspendUser({id: user.id})}>
Remove Suspension
</ActionsMenuItem> : <ActionsMenuItem
onClick={() => this.showSuspendUserDialog({
@@ -133,7 +133,7 @@ class People extends React.Component {
</ActionsMenuItem>}
{isBanned(user) ? <ActionsMenuItem
onClick={() => this.unBanUser({id: user.id})}>
onClick={() => this.unbanUser({id: user.id})}>
Remove Ban
</ActionsMenuItem> : <ActionsMenuItem
onClick={() => this.showBanUserDialog({
@@ -180,8 +180,8 @@ People.propTypes = {
onSearchChange: PropTypes.func.isRequired,
setUserRole: PropTypes.func.isRequired,
viewUserDetail: PropTypes.func.isRequired,
unBanUser: PropTypes.func.isRequired,
unSuspendUser: PropTypes.func.isRequired,
unbanUser: PropTypes.func.isRequired,
unsuspendUser: PropTypes.func.isRequired,
showSuspendUserDialog: PropTypes.func,
showBanUserDialog: PropTypes.func,
loadMore: PropTypes.func.isRequired,
@@ -95,8 +95,8 @@ class PeopleContainer extends React.Component {
setUserRole={this.setUserRole}
showSuspendUserDialog={this.props.showSuspendUserDialog}
showBanUserDialog={this.props.showBanUserDialog}
unBanUser={this.props.unBanUser}
unSuspendUser={this.props.unSuspendUser}
unbanUser={this.props.unbanUser}
unsuspendUser={this.props.unsuspendUser}
data={this.props.data}
root={this.props.root}
users={this.props.root.users}
@@ -108,8 +108,8 @@ class PeopleContainer extends React.Component {
PeopleContainer.propTypes = {
community: PropTypes.object,
setUserRole: PropTypes.func.isRequired,
unBanUser: PropTypes.func.isRequired,
unSuspendUser: PropTypes.func.isRequired,
unbanUser: PropTypes.func.isRequired,
unsuspendUser: PropTypes.func.isRequired,
viewUserDetail: PropTypes.func.isRequired,
showSuspendUserDialog: PropTypes.func,
showBanUserDialog: PropTypes.func,
+2 -2
View File
@@ -186,7 +186,7 @@ export const withUnSuspendUser = withMutation(
}
`, {
props: ({mutate}) => ({
unSuspendUser: (input) => {
unsuspendUser: (input) => {
return mutate({
variables: {
input,
@@ -282,7 +282,7 @@ export const withUnBanUser = withMutation(
}
`, {
props: ({mutate}) => ({
unBanUser: (input) => {
unbanUser: (input) => {
return mutate({
variables: {
input,