Sha256: 9c57cae6c1d921744a3e351005654d050001f3fb63c9f885ba57ecfcbff1ade6

Contents?: true

Size: 1.33 KB

Versions: 145

Compression:

Stored size: 1.33 KB

Contents

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

const PopoverScrollHeight = () => {
  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
        placement="top"
        reference={popoverTrigger}
        shouldClosePopover={handleShouldClosePopover}
        show={showPopover}
    >
      <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."
      />
      <Title
          size={4}
          text="- Christopher McCandless"
      />

    </PbReactPopover>
  )
}

export default PopoverScrollHeight

Version data entries

145 entries across 145 versions & 1 rubygems

Version Path
playbook_ui-6.8.1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-6.8.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-6.7.0.pre.alpha1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-6.7.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-6.6.1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.0.pre.alpha10 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-6.6.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-6.5.2 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha12 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha11 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha10 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha9 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-6.5.1 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-6.5.0 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha8 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha7 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha6 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha5 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha4 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx
playbook_ui-7.0.1.pre.alpha3 app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx