Sha256: 5b3b93c757090938a7d7a4180d6b4d35fdccaef7a16b626f005164f98fc568bf

Contents?: true

Size: 1.24 KB

Versions: 830

Compression:

Stored size: 1.24 KB

Contents

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

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

830 entries across 830 versions & 2 rubygems

Version Path
playbook_ui-11.20.0.pre.alpha.passthrough1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.20.0.pre.alpha.railsdialog1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.20.0.pre.alpha.focus1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.20.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.19.0.pre.alpha.map1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.19.0.pre.alpha.pagpassthrough1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.19.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.18.0.pre.alpha.pagutility1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.19.0.pre.typeahead1 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx
playbook_ui-11.18.0 app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx