Example #1
0
export const needsTokenForPrivate = () => {
  showNotification({
    type: 'info',
    body:
      'OctoLinker needs a GitHub API token to retrieve repository metadata for private repositories. <a href="#" class="js-octolinker-open-settings">Create a token</a> to enable OctoLinker for all your private repositories.',
  });
};
Example #2
0
export const tokenIsInvalid = () => {
  showNotification({
    type: 'error',
    body:
      'The token you provided is invalid. You must <a href="#" class="js-octolinker-open-settings">create a new token</a> before you can continue using OctoLinker.',
  });
};
Example #3
0
export const rateLimitExceeded = ({ isUnauthenticated, remainingTime }) => {
  const timeLeft = prettyTime(remainingTime);

  if (isUnauthenticated) {
    showNotification({
      type: 'warn',
      body: `OctoLinker exceed the GitHub API hourly limit for unauthenticated requests. You probably want to <a href="#" class="js-octolinker-open-settings">create a token</a> or wait ${timeLeft}.`,
    });
    return;
  }

  showNotification({
    type: 'warn',
    body: `OctoLinker exceed the GitHub API hourly limit. The rate limit will be reset in ${timeLeft}.`,
  });
};