SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // src/screens/home/containers/Search.js
  2. import React from 'react';
  3. import { connect } from 'react-redux'
  4. import Form from 'react-bootstrap/Form'
  5.  
  6. const Search = ({query}) => {
  7.   const handleOnSubmit = (e) => {
  8.     e.preventDefault();
  9.   }
  10.   return (
  11.     <div className="search-books">
  12.       <Form className="search-books--form" onSubmit={handleOnSubmit}>
  13.         <Form.Group>
  14.           <Form.Control type="text" placeholder="Harry Potter, Food and Love" value={query} />
  15.           <Form.Text className="text-muted">
  16.             Search the world's most comprehensive index of full-text books.
  17.           </Form.Text>
  18.         </Form.Group>
  19.       </Form>
  20.     </div>
  21.   )
  22. }
  23.  
  24. const mapStateToProps = state => {
  25.   return {
  26.     query: state.books.query
  27.   }
  28. }
  29.  
  30. export default connect(
  31.   mapStateToProps,
  32.   null
  33. )(Search);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top