From d68bc6e975aa549840cea4904fafe11f78ad3b3c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 24 Jun 2018 18:25:55 +0300 Subject: SearchBox component --- vnext/src/components/SearchBox.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 vnext/src/components/SearchBox.js (limited to 'vnext/src/components') diff --git a/vnext/src/components/SearchBox.js b/vnext/src/components/SearchBox.js new file mode 100644 index 00000000..38414c78 --- /dev/null +++ b/vnext/src/components/SearchBox.js @@ -0,0 +1,30 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +export default class SearchBox extends React.Component { + constructor(props) { + super(props) + this.state = { + search: '' + } + } + handleChange = (event) => { + this.setState({ + search: event.target.value + }) + } + onSubmit = (event) => { + event.preventDefault() + this.props.onSearch(this.state.search); + } + render() { + return
+ } +} + +SearchBox.propTypes = { + onSearch: PropTypes.func.isRequired +} -- cgit v1.2.3