Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class QueryBar extends PureComponent {
- render() {
- const { placeholder, leftIcon, onSubmit, onChange, width } = this.props;
- return (
- <form
- style={{ width }}
- onSubmit={e => {
- e.preventDefault();
- onSubmit(e.target[0].value);
- }}
- >
- <InputGroup
- placeholder={placeholder}
- width={width}
- leftIcon="search"
- rightElement={
- <Button
- type="submit"
- icon={leftIcon}
- minimal={true}
- intent={Intent.PRIMARY}
- />
- }
- />
- </form>
- );
- }
- }
- QueryBar.propTypes = {
- width: PropTypes.number,
- placeholder: PropTypes.string,
- leftIcon: PropTypes.oneOfType(['string', 'element']),
- onSubmit: PropTypes.func
- };
- QueryBar.defaultProps = {
- placeholder: 'Search...',
- leftIcon: 'arrow-right',
- width: 360
- };
- export default QueryBar;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement