From 32976d8bd6e4654bf625e5c2083979403ce15fb0 Mon Sep 17 00:00:00 2001 From: Haraldo Filho Date: Sun, 7 Mar 2021 13:46:02 -0300 Subject: [PATCH] fix: wakatime compact card bargraph rendering (#885) * fix: wakatime compact card bargraph rendering at the right side * Updated snapshots --- .gitignore | 2 + src/cards/wakatime-card.js | 18 ++++----- .../renderWakatimeCard.test.js.snap | 38 +++++++++---------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 0ecfbc22..1c96025a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ package-lock.json .vscode/ .idea/ coverage +vercel_token + diff --git a/src/cards/wakatime-card.js b/src/cards/wakatime-card.js index 5d8789e1..4adf799f 100644 --- a/src/cards/wakatime-card.js +++ b/src/cards/wakatime-card.js @@ -73,10 +73,10 @@ const createTextNode = ({ return ` ${label}: - ${value} ${cardProgress} @@ -158,17 +158,17 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => { const compactProgressBar = languages .map((lang) => { // const progress = (width * lang.percent) / 100; - const progress = ((width - 50) * lang.percent) / 100; + const progress = ((width - 25) * lang.percent) / 100; const languageColor = languageColors[lang.name] || "#858585"; const output = ` @@ -230,7 +230,7 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => { return card.render(` ${finalLayout} - + `); }; diff --git a/tests/__snapshots__/renderWakatimeCard.test.js.snap b/tests/__snapshots__/renderWakatimeCard.test.js.snap index 93542ad4..472a9bcd 100644 --- a/tests/__snapshots__/renderWakatimeCard.test.js.snap +++ b/tests/__snapshots__/renderWakatimeCard.test.js.snap @@ -100,10 +100,10 @@ exports[`Test Render Wakatime Card should render correctly 1`] = ` Other: - 19 mins @@ -123,10 +123,10 @@ exports[`Test Render Wakatime Card should render correctly 1`] = ` TypeScript: - 1 min @@ -144,7 +144,7 @@ exports[`Test Render Wakatime Card should render correctly 1`] = ` - + @@ -254,31 +254,31 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1 @@ -306,7 +306,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1 - +