Commit 46dd91fe authored by Benjamin Bouvier's avatar Benjamin Bouvier
Browse files

[client] Modernize categories code;

parent 934750fd
......@@ -9,16 +9,11 @@ import CategoryListItem from './item';
import { MODAL_SLUG as DELETE_UNUSED_MODAL_SLUG } from './delete-unused-modal';
class CategoryList extends React.Component {
constructor(props) {
super(props);
this.state = {
showForm: false
};
state = {
showForm: false
};
this.handleShowForm = this.handleShowForm.bind(this);
this.refNewCategory = this.refNewCategory.bind(this);
}
refNewCategory = React.createRef();
handleAddDefault = () => {
this.props.createDefaultCategories();
......@@ -34,16 +29,12 @@ class CategoryList extends React.Component {
function() {
// then
if (this.state.showForm) {
this.newCategory.selectTitle();
this.refNewCategory.current.selectTitle();
}
}
);
};
refNewCategory = node => {
this.newCategory = node;
};
render = () => {
let items = this.props.categories.map(cat => (
<CategoryListItem
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment