Sha256: 22b7f278f833aaf0a9fb70858f0bf9aa166e72ac2187381fcc8b0f591252f711

Contents?: true

Size: 1.25 KB

Versions: 598

Compression:

Stored size: 1.25 KB

Contents

import React, { useState } from 'react'
import {
  Button,
  Icon,
  List,
  ListItem,
  PbReactPopover,
  Flex,
} from 'playbook-ui'

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

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

  const popoverReference = (
    <Button
        onClick={handleTogglePopover}
        variant="secondary"
    >
      <Flex align="center">
        {"Filter By"}
        <Flex
            className={showPopover ? "fa-flip-vertical" : ""}
            display="inline_flex"
        >
          <Icon
              fixedWidth
              icon="angle-down"
              margin-left="xxs"
          />
        </Flex>
      </Flex>
    </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

598 entries across 598 versions & 2 rubygems

Version Path
playbook_ui_docs-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.11.1.pre.alpha.PLAY17445539 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR798datepickerturbo5537 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui_docs-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.11.1.pre.alpha.pbntr703collapsiblerowsrails5536 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui_docs-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.11.1.pre.alpha.PLAY1751pbcontenttagpt25529 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui_docs-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.11.1.pre.alpha.PBNTR7495495 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui_docs-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.12.0.pre.rc.11 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui_docs-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.12.0.pre.rc.10 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui_docs-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.12.0.pre.rc.9 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui_docs-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.12.0.pre.rc.8 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui_docs-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-14.12.0.pre.rc.7 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx