2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
2015-06-02 10:10:09 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import Input from 'react-bootstrap/lib/Input';
|
|
|
|
import Glyphicon from 'react-bootstrap/lib/Glyphicon';
|
2015-07-01 11:13:45 +02:00
|
|
|
import ButtonLink from 'react-router-bootstrap/lib/ButtonLink';
|
|
|
|
import Row from 'react-bootstrap/lib/Row';
|
|
|
|
import Col from 'react-bootstrap/lib/Col';
|
2015-06-02 11:40:55 +02:00
|
|
|
|
2015-06-02 10:10:09 +02:00
|
|
|
let PieceListToolbar = React.createClass({
|
|
|
|
|
2015-06-05 11:06:36 +02:00
|
|
|
propTypes: {
|
2015-06-16 09:27:04 +02:00
|
|
|
className: React.PropTypes.string,
|
|
|
|
searchFor: React.PropTypes.func
|
2015-06-05 11:06:36 +02:00
|
|
|
},
|
|
|
|
|
2015-06-02 10:10:09 +02:00
|
|
|
searchFor() {
|
|
|
|
let searchTerm = this.refs.search.getInputDOMNode().value;
|
2015-06-16 09:27:04 +02:00
|
|
|
this.props.searchFor(searchTerm);
|
2015-06-02 10:10:09 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
render() {
|
2015-07-01 19:05:47 +02:00
|
|
|
let searchIcon = <Glyphicon glyph='search' className="filter-glyph"/>;
|
2015-06-02 10:10:09 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={this.props.className}>
|
|
|
|
<div className="row">
|
2015-07-07 10:28:39 +02:00
|
|
|
<div className="col-xs-12 col-sm-10 col-md-8 col-lg-8 col-sm-offset-1 col-md-offset-2 col-lg-offset-2">
|
2015-06-02 10:10:09 +02:00
|
|
|
<div className="row">
|
2015-07-07 10:28:39 +02:00
|
|
|
<span className="pull-right search-bar">
|
|
|
|
<Input
|
|
|
|
type='text'
|
|
|
|
ref="search"
|
|
|
|
placeholder="Search..."
|
|
|
|
onChange={this.searchFor}
|
|
|
|
addonAfter={searchIcon} />
|
|
|
|
</span>
|
2015-06-02 10:10:09 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default PieceListToolbar;
|