import React from 'react'; import {SearchBoxProps} from '../hyper'; const searchBoxStyling: React.CSSProperties = { float: 'right', height: '28px', backgroundColor: 'white', position: 'absolute', right: '10px', top: '0px', width: '224px', zIndex: 9999 }; const enterKey = 13; export default class SearchBox extends React.PureComponent { searchTerm: string; constructor(props: SearchBoxProps) { super(props); this.searchTerm = ''; } handleChange = (event: React.KeyboardEvent) => { this.searchTerm = event.currentTarget.value; if (event.keyCode === enterKey) { this.props.search(event.currentTarget.value); } }; render() { return (
input?.focus()} /> this.props.prev(this.searchTerm)}> {'←'} this.props.next(this.searchTerm)}> {'→'} this.props.close()}> {'✕'}
); } }