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.11.0.pre.alpha.dialog1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.11.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.10.0.pre.alpha.pre.bold1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.10.0.pre.alpha.pagination1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.10.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.9.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.9.0.pre.alpha.fileupload1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.8.1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.8.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.7.0.pre.alpha.table1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.7.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.6.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.5.0.pre.alpha.fontawesome app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.7.0.pre.alpha.pre.guagechart1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.6.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.5.0.pre.alpha.datepicker1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.6.0.pre.alpha.rubocopperf1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.6.1.pre.alpha.rubocop.pre.performance1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.5.0.pre.alpha.pre.rubocop app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.6.0.pre.alpha.momenttz1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx