SHARE
TWEET

Untitled

a guest Jul 18th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class QueryBar extends PureComponent {
  2.   render() {
  3.     const { placeholder, leftIcon, onSubmit, onChange, width } = this.props;
  4.     return (
  5.       <form
  6.         style={{ width }}
  7.         onSubmit={e => {
  8.           e.preventDefault();
  9.           onSubmit(e.target[0].value);
  10.         }}
  11.       >
  12.         <InputGroup
  13.           placeholder={placeholder}
  14.           width={width}
  15.           leftIcon="search"
  16.           rightElement={
  17.             <Button
  18.               type="submit"
  19.               icon={leftIcon}
  20.               minimal={true}
  21.               intent={Intent.PRIMARY}
  22.             />
  23.           }
  24.         />
  25.       </form>
  26.     );
  27.   }
  28. }
  29.  
  30. QueryBar.propTypes = {
  31.   width: PropTypes.number,
  32.   placeholder: PropTypes.string,
  33.   leftIcon: PropTypes.oneOfType(['string', 'element']),
  34.   onSubmit: PropTypes.func
  35. };
  36.  
  37. QueryBar.defaultProps = {
  38.   placeholder: 'Search...',
  39.   leftIcon: 'arrow-right',
  40.   width: 360
  41. };
  42. export default QueryBar;
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