Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/cards/community-card-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function CommunityCardItem({
<div className="shrink-0 rounded-lg border border-primary/25 bg-primary/5 px-2.5 py-1.5 text-right sm:px-3 sm:py-2">
<p className="text-lg font-bold text-primary sm:text-xl">{item.score ?? 0}</p>
<p className="text-[10px] text-muted-foreground sm:text-[11px]">
{t("comparsion.score")}
{t("comparison.score")}
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/cards/pr-card-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function PullRequestCardItem({
<div className="shrink-0 rounded-lg border border-primary/25 bg-primary/5 px-2.5 py-1.5 text-right sm:px-3 sm:py-2">
<p className="text-lg font-bold text-primary sm:text-xl">{pr.score ?? 0}</p>
<p className="text-[10px] text-muted-foreground sm:text-[11px]">
{t("comparsion.score")}
{t("comparison.score")}
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/cards/repo-card-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function RepoCardItem({
<div className="shrink-0 rounded-lg border border-primary/25 bg-primary/5 px-2.5 py-1.5 text-right sm:px-3 sm:py-2">
<p className="text-lg font-bold text-primary sm:text-xl">{repo.score ?? 0}</p>
<p className="text-[10px] text-muted-foreground sm:text-[11px]">
{t("comparsion.score")}
{t("comparison.score")}
</p>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/features/comparison/components/comparison-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ type Props = {
type ScoreMode = "overall" | "language";

const metrics = [
{ key: "repo", label: "comparsion.repo.score" },
{ key: "pr", label: "comparsion.pr.score" },
{ key: "contribution", label: "comparsion.contribution.score" },
{ key: "final", label: "comparsion.final.score" },
{ key: "repo", label: "comparison.repo.score" },
{ key: "pr", label: "comparison.pr.score" },
{ key: "contribution", label: "comparison.contribution.score" },
{ key: "final", label: "comparison.final.score" },
] as const;

function toChartScores(user: UserResult, mode: ScoreMode) {
Expand Down
8 changes: 4 additions & 4 deletions src/features/comparison/components/comparison-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,27 @@ export function ComparisonTable({ user1, user2 }: ComparisonTableProps) {
</CardHeader>
<CardContent className="space-y-4 pt-6">
<div className="flex items-center justify-between border-b border-border pb-2">
<span className="text-muted-foreground">{t("comparsion.final.score")}</span>
<span className="text-muted-foreground">{t("comparison.final.score")}</span>
<span className="text-2xl font-bold">{user.finalScore}</span>
</div>
<div className="flex items-center justify-between">
<span className="text-muted-foreground">{t("comparsion.repo.score")}</span>
<span className="text-muted-foreground">{t("comparison.repo.score")}</span>
<span
className={`font-semibold ${user.repoScore > (idx === 0 ? user2.repoScore : user1.repoScore) ? "text-primary" : ""}`}
>
{user.repoScore}
</span>
</div>
<div className="flex items-center justify-between">
<span className="text-muted-foreground">{t("comparsion.pr.score")}</span>
<span className="text-muted-foreground">{t("comparison.pr.score")}</span>
<span
className={`font-semibold ${user.prScore > (idx === 0 ? user2.prScore : user1.prScore) ? "text-primary" : ""}`}
>
{user.prScore}
</span>
</div>
<div className="flex items-center justify-between">
<span className="text-muted-foreground">{t("comparsion.contribution.score")}</span>
<span className="text-muted-foreground">{t("comparison.contribution.score")}</span>
<span
className={`font-semibold ${user.contributionScore > (idx === 0 ? user2.contributionScore : user1.contributionScore) ? "text-primary" : ""}`}
>
Expand Down
12 changes: 6 additions & 6 deletions src/features/comparison/components/result-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,26 +211,26 @@ export function ResultDashboard({
<CardContent className="space-y-3">
<div className="grid gap-3 sm:grid-cols-2">
<ScoreCard
title={t("comparsion.final.score")}
title={t("comparison.final.score")}
rawValue={scoreData.final}
normalizedValue={scoreData.finalNormalized}
highlight={isWinner}
helperText={t("tooltip.final")}
/>
<ScoreCard
title={t("comparsion.repo.score")}
title={t("comparison.repo.score")}
rawValue={scoreData.repo}
normalizedValue={scoreData.repoNormalized}
helperText={t("tooltip.repo")}
/>
<ScoreCard
title={t("comparsion.pr.score")}
title={t("comparison.pr.score")}
rawValue={scoreData.pr}
normalizedValue={scoreData.prNormalized}
helperText={t("tooltip.pr")}
/>
<ScoreCard
title={t("comparsion.contribution.score")}
title={t("comparison.contribution.score")}
rawValue={scoreData.contribution}
normalizedValue={scoreData.contributionNormalized}
helperText={t("tooltip.contribution")}
Expand All @@ -239,14 +239,14 @@ export function ResultDashboard({
{languageScore ? (
<div className="rounded-lg border border-cyan-500/25 bg-cyan-500/5 p-3">
<p className="text-xs font-semibold uppercase tracking-wide text-cyan-700 dark:text-cyan-300">
{t("comparsion.language.final.score")}
{t("comparison.language.final.score")}
</p>
<p className="mt-1 text-xl font-bold">
{Math.round(languageScore.normalizedFinalScore ?? languageScore.finalScore)}
{languageScore.normalizedFinalScore !== undefined ? " / 100" : ""}
</p>
<p className="text-xs text-muted-foreground">
{t("comparsion.score")}: {Math.round(languageScore.finalScore)}
{t("comparison.score")}: {Math.round(languageScore.finalScore)}
</p>
</div>
) : null}
Expand Down
8 changes: 4 additions & 4 deletions src/features/developer/components/user-profile-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,29 +357,29 @@ export function UserProfileClient({ user, location, countryParam }: Props) {

<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
<ScoreCard
title={t("comparsion.final.score")}
title={t("comparison.final.score")}
rawValue={user.finalScore}
normalizedValue={user.normalizedFinalScore}
highlight={true}
helperText={t("tooltip.final")}
/>

<ScoreCard
title={t("comparsion.repo.score")}
title={t("comparison.repo.score")}
rawValue={user.repoScore}
normalizedValue={user.normalizedRepoScore}
helperText={t("tooltip.repo")}
/>

<ScoreCard
title={t("comparsion.pr.score")}
title={t("comparison.pr.score")}
rawValue={user.prScore}
normalizedValue={user.normalizedPRScore}
helperText={t("tooltip.pr")}
/>

<ScoreCard
title={t("comparsion.contribution.score")}
title={t("comparison.contribution.score")}
rawValue={user.contributionScore}
normalizedValue={user.normalizedContributionScore}
helperText={t("tooltip.contribution")}
Expand Down
8 changes: 4 additions & 4 deletions src/features/leaderboard/components/leaderboard-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export function LeaderboardTable({
onClick={() => handleSort("finalScore")}
className="inline-flex items-center gap-2 hover:text-foreground"
>
{t("comparsion.final.score")}
{t("comparison.final.score")}
<SortIcon
field="finalScore"
sortField={sortField}
Expand All @@ -209,7 +209,7 @@ export function LeaderboardTable({
onClick={() => handleSort("repoScore")}
className="inline-flex items-center gap-2 hover:text-foreground"
>
{t("comparsion.repo.score")}
{t("comparison.repo.score")}
<SortIcon
field="repoScore"
sortField={sortField}
Expand All @@ -233,7 +233,7 @@ export function LeaderboardTable({
onClick={() => handleSort("prScore")}
className="inline-flex items-center gap-2 hover:text-foreground"
>
{t("comparsion.pr.score")}
{t("comparison.pr.score")}
<SortIcon
field="prScore"
sortField={sortField}
Expand All @@ -257,7 +257,7 @@ export function LeaderboardTable({
onClick={() => handleSort("contributionScore")}
className="inline-flex items-center gap-2 hover:text-foreground"
>
{t("comparsion.contribution.score")}
{t("comparison.contribution.score")}
<SortIcon
field="contributionScore"
sortField={sortField}
Expand Down
8 changes: 4 additions & 4 deletions src/features/leaderboard/tests/leaderboard-table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"leaderboard.impactRank": "Impact Rank",
"leaderboard.search": "Search",
"leaderboard.partialErrors": "Partial Errors",
"comparsion.final.score": "Final Score",
"comparsion.repo.score": "Repo Score",
"comparsion.pr.score": "PR Score",
"comparsion.contribution.score": "Contribution Score",
"comparison.final.score": "Final Score",
"comparison.repo.score": "Repo Score",
"comparison.pr.score": "PR Score",
"comparison.contribution.score": "Contribution Score",
"a11y.openProfile": "Open profile",
};

Expand All @@ -39,7 +39,7 @@

// Mock Avatar
vi.mock("@/components/layout/avatar", () => ({
Avatar: ({ src, alt }: { src: string; alt: string }) => <img src={src} alt={alt} />,

Check warning on line 42 in src/features/leaderboard/tests/leaderboard-table.test.tsx

View workflow job for this annotation

GitHub Actions / Validate (Node 24.x)

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
}));

// Mock Tooltip components
Expand Down
22 changes: 11 additions & 11 deletions src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"chart.mode.language": "تركيز لغوي",
"chart.mode.overall": "عام",
"comparison.avatarAlt": "الصورة الرمزية لـ {name}",
"comparsion.activity.score": "درجة النشاط",
"comparsion.contribution.diff": "فرق المساهمات",
"comparsion.contribution.score": "درجة المساهمات",
"comparsion.diff": "فرق الدرجات",
"comparsion.final.score": "الدرجة النهائية",
"comparsion.language.final.score": "درجة اللغة النهائية",
"comparsion.pr.diff": "فرق طلبات السحب",
"comparsion.pr.score": "درجة طلبات السحب",
"comparsion.repo.diff": "فرق المستودعات",
"comparsion.repo.score": "درجة المستودعات",
"comparsion.score": "الدرجة",
"comparison.activity.score": "درجة النشاط",
"comparison.contribution.diff": "فرق المساهمات",
"comparison.contribution.score": "درجة المساهمات",
"comparison.diff": "فرق الدرجات",
"comparison.final.score": "الدرجة النهائية",
"comparison.language.final.score": "درجة اللغة النهائية",
"comparison.pr.diff": "فرق طلبات السحب",
"comparison.pr.score": "درجة طلبات السحب",
"comparison.repo.diff": "فرق المستودعات",
"comparison.repo.score": "درجة المستودعات",
"comparison.score": "الدرجة",
"community.comments": "تعليقات",
"community.discussion": "نقاش",
"community.issue": "مشكلة",
Expand Down
22 changes: 11 additions & 11 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
"chart.mode.language": "Language-focused",
"chart.mode.overall": "Overall",
"comparison.avatarAlt": "{name}'s avatar",
"comparsion.activity.score": "Activity Score",
"comparsion.contribution.diff": "Contribution Difference",
"comparsion.contribution.score": "Contribution Score",
"comparsion.diff": "Score Difference",
"comparsion.final.score": "Final Score",
"comparsion.language.final.score": "Language Final Score",
"comparsion.pr.diff": "PR Difference",
"comparsion.pr.score": "PR Score",
"comparsion.repo.diff": "Repository Difference",
"comparsion.repo.score": "Repository Score",
"comparsion.score": "Score",
"comparison.activity.score": "Activity Score",
"comparison.contribution.diff": "Contribution Difference",
"comparison.contribution.score": "Contribution Score",
"comparison.diff": "Score Difference",
"comparison.final.score": "Final Score",
"comparison.language.final.score": "Language Final Score",
"comparison.pr.diff": "PR Difference",
"comparison.pr.score": "PR Score",
"comparison.repo.diff": "Repository Difference",
"comparison.repo.score": "Repository Score",
"comparison.score": "Score",
"community.comments": "comments",
"community.discussion": "Discussion",
"community.issue": "Issue",
Expand Down
Loading