Skip to content

Commit

Permalink
fix: hide in top_languages interfering with number of languages displ…
Browse files Browse the repository at this point in the history
…ayed (anuraghazra#959)

* added a dark theme like the github dark theme

* fixed hide in top_languages interfering with number of languages displayed

* fixed hide in top_languages interfering with number of languages displayed

* fixed hide in top_languages interfering with number of languages displayed

* fixed misplaced function argument

* style(themes): Add GitHub dark theme (anuraghazra#758)

This styling falls in line with the recently released GitHub dark mode

Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>

* docs: add covid fund link (anuraghazra#1019)

* docs: add `npm install` step to CONTRIBUTING.md (anuraghazra#1015)

* fix: apply parseBoolean to hide_border in pin.js (anuraghazra#1014)

* feat: limit langs shown on wakatime card (anuraghazra#988)

* fix: fixed javascript oof moment

Co-authored-by: Issy <48881813+issy@users.noreply.github.com>
Co-authored-by: Anurag Hazra <hazru.anurag@gmail.com>
Co-authored-by: Mike Beaton <mjsbeaton@gmail.com>
Co-authored-by: Florian Bussmann <hallo@florian-bussmann.de>
  • Loading branch information
5 people authored and Kab1r committed Apr 4, 2022
1 parent 3d3d3a8 commit 86f8cd1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions api/top-langs.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = async (req, res) => {
username,
langs_count,
parseArray(exclude_repo),
parseArray(hide),
);

const cacheSeconds = clampValue(
Expand Down
11 changes: 8 additions & 3 deletions src/fetchers/top-languages-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ const fetcher = (variables, token) => {
);
};

async function fetchTopLanguages(username, langsCount = 5, exclude_repo = []) {
async function fetchTopLanguages(
username,
langsCount = 5,
exclude_repo = [],
hide = [],
) {
if (!username) throw Error("Invalid username");

langsCount = clampValue(parseInt(langsCount), 1, 10);
langsCount = parseInt(langsCount) + hide.length;
langsCount = clampValue(langsCount, 1, 10 + hide.length);

const res = await retryer(fetcher, { login: username });

Expand Down
6 changes: 6 additions & 0 deletions themes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ const themes = {
icon_color: "ff1aff",
text_color: "8080ff",
bg_color: "141439",
},
github_dark: {
title_color: "58a6ff",
icon_color: "da3633",
text_color: "c9d1d9",
bg_color: "0d1117",
},
ocean_dark:{
title_color: "8957B2",
Expand Down

0 comments on commit 86f8cd1

Please sign in to comment.