Sha256: 79457eebeea1b1d11f68c0486052f478ba868e73456c4feb8a33dce01bda29df

Contents?: true

Size: 1.18 KB

Versions: 246

Compression:

Stored size: 1.18 KB

Contents

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

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

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

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

  const popoverReference = (
    <CircleIconButton
        icon="info"
        onClick={handleTogglePopover}
        variant="secondary"
    />
  )

  return (
    <Flex
        orientation="row"
        vertical="center"
        {...props}
    >
      <Body text="Click info for more details" />
      &nbsp;
      <PbReactPopover
          closeOnClick="inside"
          offset
          placement="top"
          reference={popoverReference}
          shouldClosePopover={handleShouldClosePopover}
          show={showPopover}
          {...props}
      >
        <Body textAlign="center">
          <Button
              onClick={() => {alert("Let's do this!")}}
              text="Learn More"
          />
        </Body>
      </PbReactPopover>
    </Flex>
  )
}

export default PopoverActionableContent

Version data entries

246 entries across 246 versions & 2 rubygems

Version Path
playbook_ui_docs-13.18.0.pre.alpha.thor93bargraphoptions2211 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.thor93bargraphoptions2211 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui_docs-13.18.0.pre.alpha.play1141iconkitusinglibrary2210 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.play1141iconkitusinglibrary2210 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui_docs-13.18.0.pre.alpha.PLAY12062203 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.PLAY12062203 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui_docs-13.18.0.pre.alpha.powercentrainplaybookpt22201 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.powercentrainplaybookpt22201 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui_docs-13.18.0.pre.alpha.PLAY8672199 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.PLAY8672199 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui_docs-13.18.0.pre.alpha.PBNTR191AdvancedTableFinalFixes2197 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.PBNTR191AdvancedTableFinalFixes2197 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui_docs-13.18.0.pre.alpha.dependabotnpmandyarnreactrouterdom62212196 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.dependabotnpmandyarnreactrouterdom62212196 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui_docs-13.18.0.pre.alpha.dependabotnpmandyarntypescripteslintparser56202194 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.dependabotnpmandyarntypescripteslintparser56202194 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui_docs-13.18.0.pre.alpha.PLAY12062192 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.PLAY12062192 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui_docs-13.18.0.pre.alpha.useexactnodejsversionghactions2183 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx
playbook_ui-13.18.0.pre.alpha.useexactnodejsversionghactions2183 app/pb_kits/playbook/pb_popover/docs/_popover_actionable_content.jsx