Sha256: 5062ae4560f52d84d10d0ba3ee9035d39c4f6f87912a058c6b57688b763e3b57

Contents?: true

Size: 1.47 KB

Versions: 929

Compression:

Stored size: 1.47 KB

Contents

import React, { useState } from 'react'
import {
  Body,
  Button,
  PbReactPopover,
  Title,
} from '../..'

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

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

  const handleShouldClosePopover = (shouldClosePopover) => {
    setShowPopover(!shouldClosePopover)
  }

  const popoverTrigger = (
    <Button
        onClick={handleTogglePopover}
        text="Click Me"
        variant="secondary"
    />
  )

  return (
    <PbReactPopover
        closeOnClick="any"
        maxHeight="150px"
        maxWidth="240px"
        offset
        padding="md"
        paddingBottom="sm"
        paddingTop="sm"
        placement="top"
        reference={popoverTrigger}
        shouldClosePopover={handleShouldClosePopover}
        show={showPopover}
        {...props}
    >
      <Body
          marginBottom="sm"
          text="So many people live within unhappy circumstances and yet will
          not take the initiative to change their situation because they are
          conditioned to a life of security, conformity, and conservation, all of
          which may appear to give one peace of mind, but in reality, nothing is
          more damaging to the adventurous spirit."
          {...props}
      />
      <Title
          size={4}
          text="- Christopher McCandless"
          {...props}
      />

    </PbReactPopover>
  )
}

export default PopoverScrollHeight

Version data entries

929 entries across 929 versions & 2 rubygems

Version Path
playbook_ui-11.20.0.pre.alpha.passthrough1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.20.0.pre.alpha.railsdialog1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.20.0.pre.alpha.focus1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.20.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.19.0.pre.alpha.map1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.19.0.pre.alpha.pagpassthrough1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.19.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.18.0.pre.alpha.pagutility1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.19.0.pre.typeahead1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.18.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.17.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.15.0.pre.alpha.dependencies1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.16.0.pre.alpha.paginationrails1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.16.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.16.0.pre.alpha.reactupgrade1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.15.0.pre.alpha.table1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.16.0.pre.alpha.pagination.rails1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.15.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.14.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-11.13.0.pre.alpha.fontawesome1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx