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