fix: wakatime compact card bargraph rendering (#885)

* fix: wakatime compact card bargraph rendering at the right side

* Updated snapshots
This commit is contained in:
Haraldo Filho 2021-03-07 13:46:02 -03:00 committed by GitHub
parent 8e994304b3
commit 32976d8bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 28 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@ package-lock.json
.vscode/
.idea/
coverage
vercel_token

View File

@ -158,7 +158,7 @@ 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";

View File

@ -258,7 +258,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
data-testid=\\"lang-progress\\"
x=\\"0\\"
y=\\"0\\"
width=\\"6.291999999999999\\"
width=\\"6.6495\\"
height=\\"8\\"
fill=\\"#858585\\"
/>
@ -266,9 +266,9 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
<rect
mask=\\"url(#rect-mask)\\"
data-testid=\\"lang-progress\\"
x=\\"6.291999999999999\\"
x=\\"6.6495\\"
y=\\"0\\"
width=\\"0.44\\"
width=\\"0.465\\"
height=\\"8\\"
fill=\\"#2b7489\\"
/>
@ -276,9 +276,9 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
<rect
mask=\\"url(#rect-mask)\\"
data-testid=\\"lang-progress\\"
x=\\"6.731999999999999\\"
x=\\"7.1145\\"
y=\\"0\\"
width=\\"0.30800000000000005\\"
width=\\"0.32550000000000007\\"
height=\\"8\\"
fill=\\"#cb171e\\"
/>