-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathiSamples_containers.js
More file actions
58 lines (52 loc) · 1.67 KB
/
iSamples_containers.js
File metadata and controls
58 lines (52 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import PropTypes from 'prop-types';
import React from "react";
import cx from "classnames";
import CheckBoxes from 'components/checkBoxes';
class SearchFieldContainer extends React.Component {
state = {
collapse: false,
}
toggleExpand() {
this.setState({ collapse: !this.state.collapse });
}
render() {
const { bootstrapCss, onNewSearch } = this.props;
return (
<div className={cx({ "col-md-3": bootstrapCss })}>
<div className={cx({ "panel": bootstrapCss, "panel-default": bootstrapCss })}>
<header className={cx({ "panel-heading text-center": bootstrapCss })}>
<button className={cx({
"btn": bootstrapCss,
"btn-default": bootstrapCss,
"btn-xs": bootstrapCss,
"pull-left": bootstrapCss
})}
onClick={this.toggleExpand.bind(this)}>
Fields
</button>
<button className={cx({
"btn": bootstrapCss,
"btn-default": bootstrapCss,
"btn-xs": bootstrapCss,
"pull-right": bootstrapCss
})}
onClick={onNewSearch}>
New search
</button>
<label>Search</label>
</header>
<CheckBoxes collapse={this.state.collapse} onSetFields={this.props.onSetFields} />
<ul className={cx("solr-search-fields", { "list-group": bootstrapCss })}>
{this.props.children}
</ul>
</div>
</div>
);
}
}
SearchFieldContainer.propTypes = {
bootstrapCss: PropTypes.bool,
children: PropTypes.array,
onNewSearch: PropTypes.func
};
export default SearchFieldContainer;