mirror of
https://github.com/rjNemo/devbook_ts
synced 2026-06-06 02:36:39 +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-solid-svg-icons": "^5.13.0",
|
||||
"@fortawesome/react-fontawesome": "^0.1.9",
|
||||
"@octokit/rest": "^17.9.2",
|
||||
"@reduxjs/toolkit": "^1.3.6",
|
||||
"@testing-library/jest-dom": "^4.2.4",
|
||||
"@testing-library/react": "^9.3.2",
|
||||
|
|
@ -22,7 +23,6 @@
|
|||
"@typescript-eslint/eslint-plugin": "^2.34.0",
|
||||
"@typescript-eslint/parser": "^2.34.0",
|
||||
"cypress": "^4.5.0",
|
||||
"eslint": "^7.0.0",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
||||
"eslint-plugin-react": "^7.20.0",
|
||||
|
|
@ -61,4 +61,4 @@
|
|||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
|
|||
import {faThumbsUp} from '@fortawesome/free-solid-svg-icons';
|
||||
import Header from '../components/Header';
|
||||
// Typing
|
||||
import Post, {dummyPost as post} from '../models/Post';
|
||||
import Post from '../models/Post';
|
||||
import Collections from '../constants/collections';
|
||||
|
||||
interface IProps extends WithFirestoreProps {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import Experience from '../types/Experience';
|
|||
import {getTimePeriod} from '../types/TimePeriod';
|
||||
import Education from '../types/Education';
|
||||
import Repo from '../types/Repo';
|
||||
import asyncGetRepos from '../services/github';
|
||||
|
||||
interface IProps {
|
||||
dev: IDev;
|
||||
|
|
@ -46,8 +47,7 @@ const Profile: FC<IProps> = ({dev}) => {
|
|||
return <NotFound />;
|
||||
}
|
||||
|
||||
const fn = dev?.description;
|
||||
console.log(fn);
|
||||
asyncGetRepos();
|
||||
|
||||
/** return the icon corresponding to the social name */
|
||||
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": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"target": "es2017",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
|
|
@ -19,7 +15,5 @@
|
|||
"noEmit": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
"include": ["src"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue