import React from 'react';
import ReactDOM from 'react-dom';
import Api from '../api';
import Item from './item';
class Modal extends React.Component {
constructor(props) {
super(props);
this.state = {
items: [],
searching: false,
searched: false,
loadClass: 'loading',
activeKey: null
};
}
componentDidMount() {
// Avoid 'jerk' if overflow from body is hidden.
setTimeout(() => {
$('body').addClass('modal-active');
}, 200);
ReactDOM.findDOMNode(this.refs.input).focus();
setTimeout(() => {
this.setState({
loadClass: ''
});
}, 20);
}
componentWillUnmount() {
$('body').removeClass('modal-active');
}
render() {
let content = '';
let items = this.state.items.map((value) => {
return