feat(ui): forge icons on repo cards (github, gitea, mozilla)
Add SVG icons for each forge before the repo name on dashboard cards. Icons sourced from user-provided SVGs in ui/public/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -105,6 +105,14 @@ a.hot-pink {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.forge-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 6px;
|
||||
vertical-align: -2px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.project-card a {
|
||||
color: #ff4081;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ function ProjectCard({ project: p }: { project: ProjectSummary }) {
|
||||
return (
|
||||
<Link to={`/project/${p.source}/${p.repo}`} className="text-decoration-none">
|
||||
<div className="project-card p-3">
|
||||
<h5 className="mb-1">{p.repo}</h5>
|
||||
<h5 className="mb-1"><img src={forgeIcon(p.source)} alt={p.source} className="forge-icon" />{p.repo}</h5>
|
||||
<small className="text-muted d-block mb-2">
|
||||
{p.source}
|
||||
{topLangs && ` · ${topLangs}`}
|
||||
@@ -75,6 +75,15 @@ function ProjectCard({ project: p }: { project: ProjectSummary }) {
|
||||
);
|
||||
}
|
||||
|
||||
function forgeIcon(source: string): string {
|
||||
switch (source) {
|
||||
case 'github': return '/github.svg';
|
||||
case 'gitea': return '/gitea.svg';
|
||||
case 'hg': return '/mozilla.svg';
|
||||
default: return '/github.svg';
|
||||
}
|
||||
}
|
||||
|
||||
function topLanguages(langs: Record<string, number>, n: number): string {
|
||||
return Object.entries(langs)
|
||||
.sort(([, a], [, b]) => b - a)
|
||||
|
||||
Reference in New Issue
Block a user