Sha256: 6ad37942b97797395efcd541937b23ad9723cb6f4d700bfe3a08cf1cb113f44f
Contents?: true
Size: 1.03 KB
Versions: 105
Compression:
Stored size: 1.03 KB
Contents
/* @flow */ import React, { Node, useState } from 'react' import CircleIconButton from '../../pb_circle_icon_button/_circle_icon_button' import PbReactPopover from '../../pb_popover/_popover' const FiltersPopoverProps = { children: Node } const FiltersPopover = ({ children, dark, minWidth }: FiltersPopoverProps) => { const [hide, updateHide] = useState(true) const toggle = () => updateHide(!hide) const filterButton = ( <CircleIconButton dark={dark} icon="filter" id="filter" onClick={toggle} text="filter" variant="secondary" /> ) return ( <PbReactPopover closeOnClick="outside" minWidth={minWidth} placement="bottom" reference={filterButton} shouldClosePopover={updateHide} show={!hide} > <div className="pb-form"> {typeof children === 'function' ? children({ closePopover: () => (updateHide(true)) }) : children} </div> </PbReactPopover> ) } export default FiltersPopover
Version data entries
105 entries across 105 versions & 1 rubygems