import * as React from "react"; import { RootState } from "../../state"; import { Dispatch } from "redux"; import { quickSearchBackgroundClick } from "../../actions"; import { BaseModalProps } from "./view.pc"; export type Props = { root: RootState; dispatch: Dispatch; }; export default (Base: React.ComponentClass) => class ModalController extends React.PureComponent { onBackgroundClick = () => { this.props.dispatch(quickSearchBackgroundClick()); }; render() { const { root, dispatch } = this.props; const { onBackgroundClick } = this; if (!root.showQuickSearch) { return null; } return ( ); } };