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-8.0.0.pre.alpha1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.16.0.pre.alpha5 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.16.0.pre.alpha4 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.16.0.pre.alpha3 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.16.0.pre.alpha2 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.16.0.pre.alpha1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.14.0.pre.alpha1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.16.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.15.1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.15.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.14.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.13.0.pre.alpha1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.13.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.12.1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-7.12.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx