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.
Files
outline/frontend/scenes/Search/components/SearchField/SearchField.js
2017-05-11 17:23:56 -07:00

31 lines
644 B
JavaScript

// @flow
import React, { PropTypes } from 'react';
import { observer } from 'mobx-react';
import styles from './SearchField.scss';
@observer class SearchField extends React.Component {
static propTypes = {
onChange: PropTypes.func,
};
onChange = (event: SyntheticEvent) => {
event.currentTarget.value && this.props.onChange(event.currentTarget.value);
};
render() {
return (
<div className={styles.container}>
<input
onChange={this.onChange}
className={styles.field}
placeholder="Search"
autoFocus
/>
</div>
);
}
}
export default SearchField;