Sha256: 7733ce479c1a1cb255dcb67d81e5cb7f447ba2ce34aa57de2490604b418eadfe

Contents?: true

Size: 1.04 KB

Versions: 28

Compression:

Stored size: 1.04 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Spinner, Button } from '@patternfly/react-core';
import { STATUS } from 'foremanReact/constants';
import { SYNC_BUTTON_TEXT } from '../../../../ForemanInventoryConstants';

class SyncButton extends React.Component {
  state = {
    showModal: false,
  };

  toggleModal = () => {
    this.setState({ showModal: !this.state.showModal });
  };

  render() {
    const { handleSync, status } = this.props;

    const handleClick = handleSync;
    return (
      <React.Fragment>
        <Button
          className="sync_button"
          onClick={handleClick}
          size="lg"
          isDisabled={status === STATUS.PENDING}
          variant="secondary"
        >
          {status === STATUS.PENDING && <Spinner size="sm" />}
          {SYNC_BUTTON_TEXT}
        </Button>
      </React.Fragment>
    );
  }
}

SyncButton.propTypes = {
  handleSync: PropTypes.func.isRequired,
  status: PropTypes.string,
};

SyncButton.defaultProps = {
  status: null,
};

export default SyncButton;

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
foreman_rh_cloud-11.1.0 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-10.0.3 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-11.0.3 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-9.0.59 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-11.0.2 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-11.0.1 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-11.0.0 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-9.0.58 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-10.0.2 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-9.0.57 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-10.0.1 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-9.0.56 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-9.0.55 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-9.0.54 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-9.0.53 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-9.0.52 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-8.0.52 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-9.0.51 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-8.0.51 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-7.0.48 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js