This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/frontend/scenes/Search/components/SearchField/SearchField.js

30 lines
599 B
JavaScript
Raw Normal View History

2017-05-12 00:23:56 +00:00
// @flow
import React, { Component } from 'react';
2016-07-19 07:30:47 +00:00
import styles from './SearchField.scss';
class SearchField extends Component {
props: {
onChange: Function,
};
2016-07-19 07:30:47 +00:00
2017-05-26 07:04:13 +00:00
handleChange = (ev: SyntheticEvent) => {
this.props.onChange(ev.currentTarget.value ? ev.currentTarget.value : '');
};
2016-07-19 07:30:47 +00:00
render() {
return (
<div className={styles.container}>
2016-07-19 07:30:47 +00:00
<input
{...this.props}
onChange={this.handleChange}
className={styles.field}
2016-07-19 07:30:47 +00:00
placeholder="Search"
autoFocus
/>
</div>
);
}
}
export default SearchField;