From 86f8cd16ef017853ad0220e23442a34d061c98d8 Mon Sep 17 00:00:00 2001 From: Mohammed Mushahid Qureshi Date: Tue, 27 Apr 2021 01:12:24 +0530 Subject: [PATCH] fix: hide in top_languages interfering with number of languages displayed (#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 (#758) This styling falls in line with the recently released GitHub dark mode Co-authored-by: Anurag Hazra * docs: add covid fund link (#1019) * docs: add `npm install` step to CONTRIBUTING.md (#1015) * fix: apply parseBoolean to hide_border in pin.js (#1014) * feat: limit langs shown on wakatime card (#988) * fix: fixed javascript oof moment Co-authored-by: Issy <48881813+issy@users.noreply.github.com> Co-authored-by: Anurag Hazra Co-authored-by: Mike Beaton Co-authored-by: Florian Bussmann --- api/top-langs.js | 1 + src/fetchers/top-languages-fetcher.js | 11 ++++++++--- themes/index.js | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/api/top-langs.js b/api/top-langs.js index 75b7353fd3859..4de699976656e 100644 --- a/api/top-langs.js +++ b/api/top-langs.js @@ -47,6 +47,7 @@ module.exports = async (req, res) => { username, langs_count, parseArray(exclude_repo), + parseArray(hide), ); const cacheSeconds = clampValue( diff --git a/src/fetchers/top-languages-fetcher.js b/src/fetchers/top-languages-fetcher.js index 9002f219ff44e..25809901150fb 100644 --- a/src/fetchers/top-languages-fetcher.js +++ b/src/fetchers/top-languages-fetcher.js @@ -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 }); diff --git a/themes/index.js b/themes/index.js index f63f73b6b7973..af99d04e5e251 100644 --- a/themes/index.js +++ b/themes/index.js @@ -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",