Switching to @Radium decorator
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { Component, Fragment } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { reactAutoBind } from 'auto-bind2'
|
||||
import autobind from 'autobind-decorator'
|
||||
import { UserList } from './UserList'
|
||||
import { UserForm } from './UserForm'
|
||||
import { UserFormPlaceholder } from './UserFormPlaceholder'
|
||||
@@ -16,7 +16,6 @@ export class Users extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
reactAutoBind(this)
|
||||
this.state = {
|
||||
modified: false,
|
||||
selectedUser: null,
|
||||
@@ -57,6 +56,7 @@ export class Users extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleUserListClick(e, index) {
|
||||
let user = this.state.users[index]
|
||||
|
||||
@@ -74,6 +74,7 @@ export class Users extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleSave(user) {
|
||||
if (user._id) {
|
||||
this.setState({ waitModal: { message: 'Updating User' } })
|
||||
@@ -118,10 +119,12 @@ export class Users extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleChangeEmail() {
|
||||
this.setState({ changeEmailModal: { oldEmail: this.state.selectedUser.email } })
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleResendEmail() {
|
||||
this.setState({
|
||||
waitModal: { message: 'Resending Email...' }
|
||||
@@ -147,6 +150,7 @@ export class Users extends Component {
|
||||
})
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleChangeEmailDismiss(newEmail) {
|
||||
this.setState({ changeEmailModal: null })
|
||||
if (!newEmail) {
|
||||
@@ -178,6 +182,7 @@ export class Users extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleRemove() {
|
||||
this.setState({
|
||||
yesNoModal: {
|
||||
@@ -187,6 +192,7 @@ export class Users extends Component {
|
||||
})
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleRemoveModalDismiss(yes) {
|
||||
if (yes) {
|
||||
// TODO: Pass the _id back from the dialog input data
|
||||
@@ -219,6 +225,7 @@ export class Users extends Component {
|
||||
})
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleModifiedModalDismiss(yes) {
|
||||
if (yes) {
|
||||
this.setState({
|
||||
@@ -234,14 +241,17 @@ export class Users extends Component {
|
||||
})
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleMessageModalDismiss() {
|
||||
this.setState({ messageModal: null })
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleModifiedChanged(modified) {
|
||||
this.setState({ modified: modified })
|
||||
}
|
||||
|
||||
@autobind
|
||||
handleAddNewUser() {
|
||||
let newUser = {}
|
||||
let newUsers = [newUser].concat(this.state.users)
|
||||
|
||||
Reference in New Issue
Block a user