Sha256: 539d80daa09861d10b998f7b4ca9afbe8d1d7d4bbd9579dfa7dd6dd56a3af65e

Contents?: true

Size: 1.2 KB

Versions: 18

Compression:

Stored size: 1.2 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { translate as __ } from 'foremanReact/common/I18n';
import { Switch, Icon, FieldLevelHelp } from 'patternfly-react';

import './RecommendedRepositorySetsToggler.scss';

const RecommendedRepositorySetsToggler = ({
  enabled,
  className,
  children,
  help,
  onChange,
  ...props
}) => {
  const classes = classNames('recommended-repositories-toggler-container', className);

  return (
    <div className={classes} {...props}>
      <Switch
        bsSize="mini"
        value={enabled}
        onChange={() => onChange(!enabled)}
      />
      <Icon type="fa" name="star" />
      {children}
      <FieldLevelHelp content={help} />
    </div>
  );
};

RecommendedRepositorySetsToggler.propTypes = {
  enabled: PropTypes.bool,
  className: PropTypes.string,
  children: PropTypes.node,
  help: PropTypes.node,
  onChange: PropTypes.func,
};

RecommendedRepositorySetsToggler.defaultProps = {
  enabled: false,
  className: '',
  children: __('Recommended Repositories'),
  help: __('This shows repositories that are used in a typical setup.'),
  onChange: () => null,
};

export default RecommendedRepositorySetsToggler;

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
katello-4.15.0.rc2 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.15.0.rc1 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.14.1 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.14.0 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.14.0.rc3 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.14.0.rc2 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.14.0.rc1.1 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.14.0.rc1 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.13.1 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.13.0 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.12.1 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.13.0.rc1 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.12.0 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.12.0.rc3 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.12.0.rc2 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.12.0.rc1 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.11.1 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js
katello-4.11.0 webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js