Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eramdam committed Apr 4, 2021
1 parent 99813e9 commit 8aeae08
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"twitter-regexps": "^3.1.1",
"typescript": "^4.2.3",
"url-loader": "^4.1.1",
"utility-types": "^3.10.0",
"web-ext": "^5.5.0",
"webextension-polyfill-ts": "^0.25.0",
"webpack": "^5.24.3",
Expand Down
13 changes: 5 additions & 8 deletions src/components/settings/components/settingsCredits.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import {css} from '@emotion/css';
import {Octokit} from '@octokit/core';
import React, {FC, useEffect, useState} from 'react';
import {PromiseType} from 'utility-types';

import {Trans} from '../../trans';
import {settingsRegularText} from '../settingsStyles';

const octokit = new Octokit();

export const SettingsCredits: FC = () => {
const [contributors, setContributors] = useState<ReadonlyArray<GithubContributor>>([]);
const [contributors, setContributors] = useState<
PromiseType<ReturnType<typeof getGithubContributors>>
>([]);

useEffect(() => {
getGithubContributors().then(setContributors);
Expand Down Expand Up @@ -91,13 +94,7 @@ export const SettingsCredits: FC = () => {
);
};

interface GithubContributor {
contributions: number;
username: string | undefined;
url: string | undefined;
}

async function getGithubContributors(): Promise<ReadonlyArray<GithubContributor>> {
async function getGithubContributors() {
const response = await octokit.request('GET /repos/{owner}/{repo}/contributors', {
owner: 'eramdam',
repo: 'BetterTweetDeck',
Expand Down

0 comments on commit 8aeae08

Please sign in to comment.