Update airbnb eslint config to 3.0.0
This commit is contained in:
parent
9db0341973
commit
7c72cac71f
13 changed files with 114 additions and 99 deletions
|
@ -10,25 +10,27 @@ export default class Search extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { search, onSearch } = this.props;
|
||||
const results = search.results.map(result => {
|
||||
return (
|
||||
<p key={result.id}>{timestamp(new Date(result.time * 1000))} {result.from} {result.content}</p>
|
||||
);
|
||||
});
|
||||
handleSearch = e => this.props.onSearch(e.target.value)
|
||||
|
||||
render() {
|
||||
const { search } = this.props;
|
||||
const style = {
|
||||
display: search.show ? 'block' : 'none'
|
||||
};
|
||||
|
||||
const results = search.results.map(result => (
|
||||
<p key={result.id}>
|
||||
{timestamp(new Date(result.time * 1000))} {result.from} {result.content}
|
||||
</p>
|
||||
));
|
||||
|
||||
return (
|
||||
<div className="search" style={style}>
|
||||
<input
|
||||
ref="input"
|
||||
className="search-input"
|
||||
type="text"
|
||||
onChange={e => onSearch(e.target.value)}
|
||||
onChange={this.handleSearch}
|
||||
/>
|
||||
<div className="search-results">{results}</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue