Sha256: eb1303b2997a3aabb7226855ed74afb5b5c7e7cceffc928d378d541b017ff319

Contents?: true

Size: 742 Bytes

Versions: 26

Compression:

Stored size: 742 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Popover } from '@patternfly/react-core';
import { HelpIcon } from '@patternfly/react-icons';

export const HelpLabel = ({ text, id, className }) => {
  if (!text) return null;
  return (
    <Popover id={`${id}-help`} bodyContent={text} aria-label="help-text">
      <button
        onClick={e => e.preventDefault()}
        className={`pf-c-form__group-label-help ${className}`}
      >
        <HelpIcon noVerticalAlign />
      </button>
    </Popover>
  );
};

HelpLabel.propTypes = {
  id: PropTypes.string.isRequired,
  text: PropTypes.string,
  className: PropTypes.string,
};
HelpLabel.defaultProps = {
  text: '',
  className: '',
};

export default HelpLabel;

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.33 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.32 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.29 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.28 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.26 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-4.0.25.1 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.25 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-4.0.25 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.24.1 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-4.0.24.1 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.24 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-4.0.24 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.23 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-4.0.23 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.22 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-4.0.22 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-4.0.21.1 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.21.1 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.21 webpack/common/Switcher/HelpLabel.js
foreman_rh_cloud-3.0.20 webpack/common/Switcher/HelpLabel.js