import React from "react" import { Skeleton } from "antd" import { Icons } from "components/Icons" import { PostsList, Searcher } from "components" import Post from "models/post" import "./index.less" export default class ExplorePosts extends React.Component { state = { focusedSearcher: false, filledSearcher: false, } toggleFocusSearcher = (to) => { to = to ?? !this.state.focusedSearcher this.setState({ focusedSearcher: to }) } toggleState = (key, to) => { to = to ?? !this.state[key] this.setState({ [key]: to }) } render() { return
this.toggleState("focusedSearcher", true)} onUnfocus={() => this.toggleState("focusedSearcher", false)} onFilled={() => this.toggleState("filledSearcher", true)} onEmpty={() => this.toggleState("filledSearcher", false)} />
{ this.state.focusedSearcher || this.state.filledSearcher ? null : }
} }