diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-18 01:03:10 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-18 01:03:10 +0100 |
| commit | 7b8e6f9a7d3eb36b72b53d5e754b9c7916b98ed7 (patch) | |
| tree | e0445a2709ecf07e770a9b0ddecb8eeb3d168931 /client/nameSearch/nameSearch.query.js | |
| parent | d3be915bc5725a36dee867b07404725177783460 (diff) | |
namesearchg
Diffstat (limited to 'client/nameSearch/nameSearch.query.js')
| -rw-r--r-- | client/nameSearch/nameSearch.query.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/client/nameSearch/nameSearch.query.js b/client/nameSearch/nameSearch.query.js new file mode 100644 index 00000000..b82e324b --- /dev/null +++ b/client/nameSearch/nameSearch.query.js @@ -0,0 +1,48 @@ +import React, { Component } from 'react' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' + +import * as actions from './nameSearch.actions' + +class NameSearchQuery extends Component { + state = { + value: null + } + + handleInput(value) { + this.setState({ q: value }) + if (value.length > 2) { + this.props.actions.search(this.props.payload, value) + } + } + + render() { + return ( + <div className='query'> + <h2>Find Your Name</h2> + <h3>Searching {13456} identities</h3> + <p> + {'Enter your name to see if you were included in this dataset..'} + </p> + <input + type="text" + class="q" + placeholder="Enter your name" + value={this.state.q} + onInput={e => this.handleInput(e.target.value)} + /> + </div> + ) + } +} + +const mapStateToProps = state => ({ + result: state.nameSearch.result, + options: state.nameSearch.options, +}) + +const mapDispatchToProps = dispatch => ({ + actions: bindActionCreators({ ...actions }, dispatch), +}) + +export default connect(mapStateToProps, mapDispatchToProps)(NameSearchQuery) |
