Sha256: eed99378a840bb05a95e50f3b3aaffd9aa4d683ff3d004b25a5442b4715486d3

Contents?: true

Size: 1.1 KB

Versions: 16

Compression:

Stored size: 1.1 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import { Spinner, Button } from '@patternfly/react-core';
import { RedoIcon } from '@patternfly/react-icons';
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" /> : <RedoIcon />}
          {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

16 entries across 16 versions & 1 rubygems

Version Path
foreman_rh_cloud-6.0.45 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.46 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.45 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.44 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-6.0.44 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.43 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-6.0.42.2 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-6.0.42.1 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-6.0.43 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.42 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-6.0.42 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.41 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.39 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.38 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.37 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js
foreman_rh_cloud-5.0.36 webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButton.js