Sha256: 8b981d7836e119c0ad6a8a404eae5863ba63f578dea1ed7b76dc7cef88a0374d

Contents?: true

Size: 829 Bytes

Versions: 8

Compression:

Stored size: 829 Bytes

Contents

/* @flow */

import React, { Node, useState } from 'react'
import { CircleIconButton, PbReactPopover } from '../../'

const FiltersPopoverProps = { children: Node }
const FiltersPopover = ({ children, dark }: 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"
        placement="bottom"
        reference={filterButton}
        shouldClosePopover={updateHide}
        show={!hide}
    >
      <div className="pb-form">
        {children}
      </div>
    </PbReactPopover>
  )
}

export default FiltersPopover

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
playbook_ui-7.11.0.pre.alpha1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-7.10.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-7.9.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-7.8.4 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-7.8.3 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-7.8.2 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-7.8.1 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx
playbook_ui-7.8.0 app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx