Sha256: 890791f219476e27dadb13500aec3eceb2242e365aa251f084bf64d11a2f124b
Contents?: true
Size: 975 Bytes
Versions: 90
Compression:
Stored size: 975 Bytes
Contents
/* @flow */ import React, { Node, useState } from 'react' import { CircleIconButton, PbReactPopover } from '../../' 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
90 entries across 90 versions & 1 rubygems