Skip to content

Commit

Permalink
fix: fix repoContrib confusion (#2269) (#2274)
Browse files Browse the repository at this point in the history
This commit prevents confusion about the Contributed to stat. Currently,
only the last year's results are shown, but it looks like it is the
all-time contribution count (see #2269). This commit adds a ' (last year)'
suffix to prevent this confusion from happening.
  • Loading branch information
rickstaa committed Nov 22, 2022
1 parent 0efb982 commit ad3726e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/cards/stats-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
},
contribs: {
icon: icons.contribs,
label: i18n.t("statcard.contribs"),
label: i18n.t("statcard.contribs") + " (last year)",
value: contributedTo,
id: "contribs",
},
Expand Down Expand Up @@ -186,7 +186,7 @@ const renderStatsCard = (stats = {}, options = { hide: [] }) => {
index,
showIcons: show_icons,
shiftValuePos:
(!include_all_commits ? 50 : 35) + (isLongLocale ? 50 : 0),
(!include_all_commits ? 79.01 : 35) + (isLongLocale ? 50 : 0),
bold: text_bold,
}),
);
Expand Down
2 changes: 1 addition & 1 deletion tests/renderStatsCard.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ describe("Test renderStatsCard", () => {
document.querySelector(
'g[transform="translate(0, 100)"]>.stagger>.stat.bold',
).textContent,
).toMatchInlineSnapshot(`"参与项目数:"`);
).toMatchInlineSnapshot(`"参与项目数 (last year):"`);
});

it("should render without rounding", () => {
Expand Down

1 comment on commit ad3726e

@vercel
Copy link

@vercel vercel bot commented on ad3726e Nov 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.