import Link from 'next/link' import React from 'react' import { ChevronDown, ChevronRight } from 'react-feather' import config from '../config' import '../styl/styl.styl' interface Props { categories?: Array onQuery?: (query: string, sort?: boolean) => void onHeight?: (height: number) => void } interface States { follow?: boolean height?: number } export default class Filters extends React.Component { private input = undefined public render() { return ( ) } private setInput = (element) => { this.input = element } private onKeyDown = (ev: React.KeyboardEvent) => { setTimeout(() => { this.submit() }, 1) } private onClick = () => { if (this.input.value !== '') { this.submit() return } this.input.focus() } private onChange = (ev) => { this.submit(ev.target.value === 'true') } private submit = (sort?: boolean) => { if (this.props.onQuery) { this.props.onQuery(this.input.value, sort) } } }