mirror of
https://github.com/rjNemo/devbook_ts
synced 2026-06-12 13:36:43 +00:00
fetch git repos
This commit is contained in:
parent
b0ff4afde7
commit
8cb35be1d1
6 changed files with 746 additions and 682 deletions
|
|
@ -9,6 +9,7 @@
|
||||||
"@fortawesome/free-regular-svg-icons": "^5.13.0",
|
"@fortawesome/free-regular-svg-icons": "^5.13.0",
|
||||||
"@fortawesome/free-solid-svg-icons": "^5.13.0",
|
"@fortawesome/free-solid-svg-icons": "^5.13.0",
|
||||||
"@fortawesome/react-fontawesome": "^0.1.9",
|
"@fortawesome/react-fontawesome": "^0.1.9",
|
||||||
|
"@octokit/rest": "^17.9.2",
|
||||||
"@reduxjs/toolkit": "^1.3.6",
|
"@reduxjs/toolkit": "^1.3.6",
|
||||||
"@testing-library/jest-dom": "^4.2.4",
|
"@testing-library/jest-dom": "^4.2.4",
|
||||||
"@testing-library/react": "^9.3.2",
|
"@testing-library/react": "^9.3.2",
|
||||||
|
|
@ -22,7 +23,6 @@
|
||||||
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
||||||
"@typescript-eslint/parser": "^2.34.0",
|
"@typescript-eslint/parser": "^2.34.0",
|
||||||
"cypress": "^4.5.0",
|
"cypress": "^4.5.0",
|
||||||
"eslint": "^7.0.0",
|
|
||||||
"eslint-plugin-import": "^2.20.2",
|
"eslint-plugin-import": "^2.20.2",
|
||||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
"eslint-plugin-jsx-a11y": "^6.2.3",
|
||||||
"eslint-plugin-react": "^7.20.0",
|
"eslint-plugin-react": "^7.20.0",
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
||||||
import {faThumbsUp} from '@fortawesome/free-solid-svg-icons';
|
import {faThumbsUp} from '@fortawesome/free-solid-svg-icons';
|
||||||
import Header from '../components/Header';
|
import Header from '../components/Header';
|
||||||
// Typing
|
// Typing
|
||||||
import Post, {dummyPost as post} from '../models/Post';
|
import Post from '../models/Post';
|
||||||
import Collections from '../constants/collections';
|
import Collections from '../constants/collections';
|
||||||
|
|
||||||
interface IProps extends WithFirestoreProps {
|
interface IProps extends WithFirestoreProps {
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import Experience from '../types/Experience';
|
||||||
import {getTimePeriod} from '../types/TimePeriod';
|
import {getTimePeriod} from '../types/TimePeriod';
|
||||||
import Education from '../types/Education';
|
import Education from '../types/Education';
|
||||||
import Repo from '../types/Repo';
|
import Repo from '../types/Repo';
|
||||||
|
import asyncGetRepos from '../services/github';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
dev: IDev;
|
dev: IDev;
|
||||||
|
|
@ -46,8 +47,7 @@ const Profile: FC<IProps> = ({dev}) => {
|
||||||
return <NotFound />;
|
return <NotFound />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn = dev?.description;
|
asyncGetRepos();
|
||||||
console.log(fn);
|
|
||||||
|
|
||||||
/** return the icon corresponding to the social name */
|
/** return the icon corresponding to the social name */
|
||||||
const renderSocialIcon = (name: string): IconDefinition => {
|
const renderSocialIcon = (name: string): IconDefinition => {
|
||||||
|
|
|
||||||
16
src/services/github/index.ts
Normal file
16
src/services/github/index.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Github
|
||||||
|
import {Octokit} from '@octokit/rest';
|
||||||
|
|
||||||
|
/** official GitHub wrapper library */
|
||||||
|
const octokit = new Octokit({
|
||||||
|
auth: process.env.REACT_APP_GITHUB_TOKEN,
|
||||||
|
userAgent: 'devBook v1',
|
||||||
|
});
|
||||||
|
|
||||||
|
export default async () => {
|
||||||
|
const {data: repos} = await octokit.repos.listForAuthenticatedUser({
|
||||||
|
owner: 'rjNemo',
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(repos);
|
||||||
|
};
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es2017",
|
||||||
"lib": [
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"esnext"
|
|
||||||
],
|
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
|
@ -19,7 +15,5 @@
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "react"
|
"jsx": "react"
|
||||||
},
|
},
|
||||||
"include": [
|
"include": ["src"]
|
||||||
"src"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue