Sha256: 7804b6eaada99d0ff649756c53e894721ea5b9b46d8326719ca8699bcd6e9c94

Contents?: true

Size: 587 Bytes

Versions: 50

Compression:

Stored size: 587 Bytes

Contents

import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Dropdown, KebabToggle } from '@patternfly/react-core';

const DropdownToggle = ({ items, ...props }) => {
  const [isOpen, setOpen] = useState(false);
  return (
    <Dropdown
      onSelect={() => setOpen(false)}
      toggle={<KebabToggle onToggle={value => setOpen(value)} />}
      isOpen={isOpen}
      isPlain
      dropdownItems={items}
      position="right"
      {...props}
    />
  );
};

DropdownToggle.propTypes = {
  items: PropTypes.array.isRequired,
};

export default DropdownToggle;

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
foreman_rh_cloud-10.0.3 webpack/common/DropdownToggle.js
foreman_rh_cloud-11.0.3 webpack/common/DropdownToggle.js
foreman_rh_cloud-9.0.59 webpack/common/DropdownToggle.js
foreman_rh_cloud-11.0.2 webpack/common/DropdownToggle.js
foreman_rh_cloud-11.0.1 webpack/common/DropdownToggle.js
foreman_rh_cloud-11.0.0 webpack/common/DropdownToggle.js
foreman_rh_cloud-9.0.58 webpack/common/DropdownToggle.js
foreman_rh_cloud-10.0.2 webpack/common/DropdownToggle.js
foreman_rh_cloud-9.0.57 webpack/common/DropdownToggle.js
foreman_rh_cloud-10.0.1 webpack/common/DropdownToggle.js
foreman_rh_cloud-9.0.56 webpack/common/DropdownToggle.js
foreman_rh_cloud-9.0.55 webpack/common/DropdownToggle.js
foreman_rh_cloud-9.0.54 webpack/common/DropdownToggle.js
foreman_rh_cloud-9.0.53 webpack/common/DropdownToggle.js
foreman_rh_cloud-9.0.52 webpack/common/DropdownToggle.js
foreman_rh_cloud-8.0.52 webpack/common/DropdownToggle.js
foreman_rh_cloud-9.0.51 webpack/common/DropdownToggle.js
foreman_rh_cloud-8.0.51 webpack/common/DropdownToggle.js
foreman_rh_cloud-7.0.48 webpack/common/DropdownToggle.js
foreman_rh_cloud-7.0.47 webpack/common/DropdownToggle.js