Skip to content

Commit 6cc7e03

Browse files
added org login in repos list
1 parent 613fc6e commit 6cc7e03

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

src/apis/apis.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class APIService {
1818
{
1919
query: "query GetUserDetails($username: String!) { user(login: $username)" +
2020
"{ name login followers { totalCount } repositories(first: 100, orderBy: {field: STARGAZERS, direction: DESC})" +
21-
"{ nodes { name stargazerCount } } } } }",
21+
"{ nodes { name owner { login } stargazerCount } } } } }",
2222
variables: {
2323
username: username
2424
}

src/apis/types.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ interface GithubRepos {
99
repositories: {
1010
nodes: {
1111
name: string,
12+
owner: {
13+
login: string
14+
},
1215
stargazerCount: number
1316

1417
}[]

src/config.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ const config: ConfigType = {
2020
typeColor: (type: TypeofTypes): string => {
2121
switch (type) {
2222
case 'bigint':
23-
case 'number': return '#b5cea8';
23+
case 'number':
24+
return '#b5cea8';
2425
case 'object':
2526
case 'undefined':
26-
case 'boolean': return '#569cd6';
27-
case 'function': return '#dcdcaa';
28-
default: return '#ce9178';
27+
case 'boolean':
28+
return '#569cd6';
29+
case 'function':
30+
return '#dcdcaa';
31+
default:
32+
return '#ce9178';
2933
}
3034
},
3135
/**

src/widget/widget.service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ export class WidgetService {
6262
]);
6363

6464
const top_repos = github_data?.data?.user?.repositories?.nodes?.slice(0, 3)
65-
?.reduce((acc, value) => ({ ...acc, [value.name]: value.stargazerCount }), {});
65+
?.reduce((acc, value) => {
66+
const name = github_data.data.user.login !== value.owner.login ?
67+
`${value.owner.login}/${value.name}`
68+
:
69+
value.name;
70+
return { ...acc, [name]: value.stargazerCount }
71+
}, {});
6672

6773
const top_langs = wakatime_last?.data?.slice(0, 3)
6874
?.reduce((acc, value) => ({ ...acc, [value.name.toLowerCase().replaceAll('+', 'p')]: value.text }), {});

0 commit comments

Comments
 (0)