quick-search.js 606 B

1234567891011121314151617181920212223242526
  1. import React from "react"
  2. export default class extends React.Component {
  3. getClassName() {
  4. if (this.props.className) {
  5. return "form-search " + this.props.className
  6. } else {
  7. return "form-search"
  8. }
  9. }
  10. render() {
  11. return (
  12. <div className={this.getClassName()}>
  13. <input
  14. type="text"
  15. className="form-control"
  16. value={this.props.value}
  17. onChange={this.props.onChange}
  18. placeholder={this.props.placeholder || gettext("Search...")}
  19. />
  20. <span className="material-icon">search</span>
  21. </div>
  22. )
  23. }
  24. }