File tree Expand file tree Collapse file tree 3 files changed +56
-9
lines changed Expand file tree Collapse file tree 3 files changed +56
-9
lines changed Original file line number Diff line number Diff line change @@ -72,16 +72,16 @@ const About: React.FC = () => {
72
72
</ p >
73
73
</ div >
74
74
75
- < div className = "AboutImageContainer" >
76
- < img
77
- className = "AboutImage"
78
- src = { `${ process . env . PUBLIC_URL } /carson.webp` }
79
- alt = "PlaceHolder "
80
- />
81
- </ div >
82
- </ div >
75
+ { /* <div className="AboutImageContainer">
76
+ <img
77
+ className="AboutImage"
78
+ src={`${process.env.PUBLIC_URL}/carson.webp` }
79
+ alt="Carson "
80
+ />
81
+ </div>*/ }
82
+ </ div >
83
83
</ div >
84
84
) ;
85
85
} ;
86
86
87
- export default About ;
87
+ export default About ;
Original file line number Diff line number Diff line change
1
+ // https://api.github.com/users/carsonSgit
2
+
3
+ import { TopLanguage , LanguageData } from '../Interfaces/githubStats' ;
4
+
5
+ export const getGitHubProfileStats = async ( ) => {
6
+ const response = await fetch ( 'https://api.github.com/users/carsonSgit' ) ;
7
+ const data = await response . json ( ) ;
8
+ return data ;
9
+ }
10
+
11
+ export const getGitHubProfileLanguages = async ( ) : Promise < TopLanguage [ ] > => {
12
+ const reposResponse = await fetch ( 'https://api.github.com/users/carsonSgit/repos' ) ;
13
+ const reposData = await reposResponse . json ( ) ;
14
+
15
+ const languageMap : Record < string , number > = { } ;
16
+
17
+ for ( const repo of reposData ) {
18
+ const languagesResponse = await fetch ( `https://api.github.com/repos/carsonSgit/${ repo . name } /languages` ) ;
19
+ const languagesData : LanguageData = await languagesResponse . json ( ) ;
20
+
21
+ for ( const [ language , bytes ] of Object . entries ( languagesData ) ) {
22
+ if ( language !== 'Jupyter Notebook' && language !== 'HTML' && language !== 'CSS' && language !== 'Mermaid' && language !== 'SCSS' ) {
23
+ languageMap [ language ] = ( languageMap [ language ] || 0 ) + bytes ;
24
+ }
25
+ }
26
+ }
27
+
28
+ return Object . entries ( languageMap )
29
+ . sort ( ( [ , a ] , [ , b ] ) => b - a )
30
+ . slice ( 0 , 5 )
31
+ . map ( ( [ language , bytes ] ) => ( { language, bytes } ) ) ;
32
+ } ;
Original file line number Diff line number Diff line change
1
+ export interface GitHubStats {
2
+ login : string ;
3
+ public_repos : number ;
4
+ followers : number ;
5
+ following : number ;
6
+ }
7
+
8
+ export interface LanguageData {
9
+ [ key : string ] : number ;
10
+ }
11
+
12
+ export interface TopLanguage {
13
+ language : string ;
14
+ bytes : number ;
15
+ }
You can’t perform that action at this time.
0 commit comments