Sha256: 1383b8070d484271689e4d9322b14a6c2f9fe30f5c1dcdd2d7ef5d8a9931620d

Contents?: true

Size: 1.01 KB

Versions: 235

Compression:

Stored size: 1.01 KB

Contents

import React, { useState } from 'react'
import {
  Button,
  Icon,
  List,
  ListItem,
  PbReactPopover,
} from '../..'

const PopoverWithButton = (props) => {
  const [showPopover, setShowPopover] = useState(false)

  const handleTogglePopover = () => {
    setShowPopover(!showPopover)
  }

  const popoverReference = (
    <Button
        onClick={handleTogglePopover}
        variant="secondary"
    >
      {'Filter By'}
      <Icon
          fixedWidth
          icon="angle-down"
      />
    </Button>
  )

  return (
    <PbReactPopover
        padding="none"
        placement="bottom"
        reference={popoverReference}
        show={showPopover}
        {...props}
    >
      <List xpadding>
        <ListItem><a>{'Popularity'}</a></ListItem>
        <ListItem><a>{'Title'}</a></ListItem>
        <ListItem><a>{'Duration'}</a></ListItem>
        <ListItem><a>{'Date Started'}</a></ListItem>
        <ListItem><a>{'Date Ended'}</a></ListItem>
      </List>
    </PbReactPopover>
  )
}

export default PopoverWithButton

Version data entries

235 entries across 235 versions & 1 rubygems

Version Path
playbook_ui-11.17.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.15.0.pre.alpha.dependencies1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.16.0.pre.alpha.paginationrails1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.16.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.16.0.pre.alpha.reactupgrade1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.15.0.pre.alpha.table1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.16.0.pre.alpha.pagination.rails1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.15.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.14.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.13.0.pre.alpha.fontawesome1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.13.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.12.1.pre.alpha.charts1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.12.1.pre.alpha.passphrase1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.12.1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.13.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.12.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.11.0.pre.alpha.paginate2 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.11.0.pre.alpha.dialog2 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.11.0.pre.alpha.paginate1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.11.0.pre.alpha.renderer1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx