| 30 | } |
| 31 | |
| 32 | render() { |
| 33 | const { _t } = app.context |
| 34 | const { searchValue, searchTitles } = this.props |
| 35 | if(searchTitles && searchTitles.length > 0) { |
| 36 | const placeholder = _t('Search') + ' ' + searchTitles.join(', ') |
| 37 | return ( |
| 38 | <Form inline onSubmit={this.onSearch.bind(this)}> |
| 39 | <InputGroup> |
| 40 | <Form.Control value={this.state.value} |
| 41 | onKeyPress={this.onKeyPress.bind(this)} |
| 42 | placeholder={placeholder} onChange={(e)=>{this.setState({ value: e.target.value })}} /> |
| 43 | <InputGroup.Append> |
| 44 | <Button type="submit"><Icon name="search" /></Button> |
| 45 | </InputGroup.Append> |
| 46 | </InputGroup> |
| 47 | </Form> |
| 48 | ) |
| 49 | } |
| 50 | return null |
| 51 | } |
| 52 | |
| 53 | } |
| 54 | |