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.9.0.alpha.inline1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.9.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.8.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.7.0.pre.alphawidth1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.7.0.pre.alpha.a11y.btn app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.7.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.6.1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.6.1.pre.deps1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.6.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.5.0.alpha.rs.downgrade app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.5.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.4.0.alpha.sisense app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.4.0.alpha.user.kit.bug app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.4.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.3.1.pre.alpha2 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.4.0.pre.alpha2 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.4.0.pre.alpha1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.3.1.pre.alpha1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.3.0.alpha.inline3 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-9.3.0.pre.alpha.password.strength.2 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx