{"size": 1637, "ext": "js", "max_stars_repo_path": "shared/components/loaders/Loader/Loader.js", "max_stars_repo_name": "jeksman/MultiCurrencyWallet", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "shared/components/loaders/Loader/Loader.js", "max_issues_repo_name": "jeksman/MultiCurrencyWallet", "max_issues_repo_issues_event_min_datetime": "2020-07-22T12:01:00.000Z", "max_issues_repo_issues_event_max_datetime": "2020-08-23T17:23:06.000Z", "max_forks_repo_path": "shared/components/loaders/Loader/Loader.js", "max_forks_repo_name": "jeksman/MultiCurrencyWallet", "max_forks_repo_forks_event_min_datetime": "2022-01-27T23:36:41.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-27T23:36:41.000Z"}
{"max_stars_count": null, "max_issues_count": 4, "max_forks_count": 1, "avg_line_length": 28.7192982456, "max_line_length": 103, "alphanum_fraction": 0.6291997557}
import React from "react";
import PropTypes from "prop-types";

import CSSModules from "react-css-modules";
import styles from "./Loader.scss";

import { tips } from "helpers";
import { FormattedMessage } from "react-intl";

import config from "app-config";

const isFirefox = navigator.userAgent.indexOf("Firefox") !== -1;
const isWidget = config && config.isWidget;

const Loader = ({ overlayClassName, className, data, showTips, showMyOwnTip }) => (
  <div styleName="Firefox overlay" className={overlayClassName}>
    <div>
      <div styleName="loader" className={className}>
        <div styleName="loader1" />
        <div styleName="loader2" />
        <div styleName="loader3" />
      </div>
      {data && data.txId && (
        <p styleName="text">
          <FormattedMessage
            id="Loader21"
            defaultMessage="Please wait, it takes from 3 to 5 minutes to complete the transaction."
          />
        </p>
      )}
      {data && data.txId && (
        <a href={data.txId} styleName="link" target="_blank" rel="noopener noreferrer">
          {data.txId}
        </a>
      )}
      {showTips && !isWidget && !Boolean(showMyOwnTip) && <div styleName="tips">{tips("loader")}</div>}
      {!isWidget && Boolean(showMyOwnTip) && <div styleName="tips">{showMyOwnTip}</div>}
    </div>
  </div>
);

Loader.propTypes = {
  overlayClassName: PropTypes.string,
  className: PropTypes.string,
  data: PropTypes.shape({
    txId: PropTypes.string
  }),
  showTips: PropTypes.bool
};

Loader.deafultProps = {
  data: null,
  showTips: false
};

export default CSSModules(Loader, styles, { allowMultiple: true });
