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

Version Path
playbook_ui-9.19.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.19.0.pre.alphafonts app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.18.0.flow.bin.alpha app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.18.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.17.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.17.0.pre.decouple.website2 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.16.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.15.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.15.0.pre.decouple.website1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.14.1.alpha.radio.alignment app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.14.1.alpha.highcharts9 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.14.1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.13.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.12.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.12.0.pre.text.addon app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.11.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.10.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.10.0.pre.alpha2 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.10.0.pre.alpha1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx