Skip to content

Commit bab498b

Browse files
committed
Remove tag pills from projects pages
1 parent 1970b8d commit bab498b

3 files changed

Lines changed: 22 additions & 108 deletions

File tree

src/pages/Project.jsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,10 @@ export default function Project() {
4444
</a>
4545
</p>
4646

47-
<div className="tag-row tag-row--compact" aria-label="Project tags">
48-
{project.tags.map((tag) => (
49-
<Link key={tag} className="tag" to={`/projects?tag=${encodeURIComponent(tag)}`}>
50-
#{tag}
51-
</Link>
52-
))}
53-
</div>
54-
5547
{project.body.map((paragraph) => (
5648
<p key={paragraph}>{paragraph}</p>
5749
))}
5850
</div>
5951
</section>
6052
);
6153
}
62-

src/pages/Projects.jsx

Lines changed: 22 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,38 @@
1-
import { useEffect, useMemo } from 'react';
2-
import { Link, useSearchParams } from 'react-router-dom';
1+
import { useEffect } from 'react';
2+
import { Link } from 'react-router-dom';
33
import { projects } from '../data/projects.js';
44

55
export default function Projects() {
6-
const [searchParams] = useSearchParams();
7-
const activeTag = searchParams.get('tag');
8-
96
useEffect(() => {
107
document.title = 'Projects - David Bingmann';
118
}, []);
129

13-
const allTags = useMemo(() => {
14-
const tags = new Set();
15-
projects.forEach((project) => project.tags.forEach((tag) => tags.add(tag)));
16-
return Array.from(tags).sort((a, b) => a.localeCompare(b));
17-
}, []);
18-
19-
const visibleProjects = activeTag
20-
? projects.filter((project) => project.tags.includes(activeTag))
21-
: projects;
22-
2310
return (
2411
<section className="section">
2512
<h1 className="section-title">projects/</h1>
26-
27-
<div className="tag-row" aria-label="Project tag filter">
28-
<Link className={`tag${activeTag ? '' : ' tag--active'}`} to="/projects">
29-
all
30-
</Link>
31-
{allTags.map((tag) => (
32-
<Link
33-
key={tag}
34-
className={`tag${activeTag === tag ? ' tag--active' : ''}`}
35-
to={`/projects?tag=${encodeURIComponent(tag)}`}
13+
<div className="project-list">
14+
{projects.map((project, index) => (
15+
<article
16+
key={project.slug}
17+
className="project-card"
18+
style={{ '--delay': `${index * 120}ms` }}
3619
>
37-
#{tag}
38-
</Link>
20+
<h2 className="project-card-title">
21+
<Link className="project-title-link" to={`/projects/${project.slug}`}>
22+
{project.title} Project
23+
</Link>
24+
</h2>
25+
<p className="project-card-headline">{project.headline}</p>
26+
<p className="project-card-summary">{project.summary}</p>
27+
28+
<p className="project-card-meta">
29+
<a href={project.repo.href} target="_blank" rel="noreferrer">
30+
{project.repo.label}
31+
</a>
32+
</p>
33+
</article>
3934
))}
4035
</div>
41-
42-
{visibleProjects.length === 0 ? (
43-
<div className="empty-note">No projects found for that tag.</div>
44-
) : (
45-
<div className="project-list">
46-
{visibleProjects.map((project, index) => (
47-
<article
48-
key={project.slug}
49-
className="project-card"
50-
style={{ '--delay': `${index * 120}ms` }}
51-
>
52-
<h2 className="project-card-title">
53-
<Link className="project-title-link" to={`/projects/${project.slug}`}>
54-
{project.title} Project
55-
</Link>
56-
</h2>
57-
<p className="project-card-headline">{project.headline}</p>
58-
<p className="project-card-summary">{project.summary}</p>
59-
60-
<div className="tag-row tag-row--compact" aria-label="Project tags">
61-
{project.tags.map((tag) => (
62-
<Link key={tag} className="tag" to={`/projects?tag=${encodeURIComponent(tag)}`}>
63-
#{tag}
64-
</Link>
65-
))}
66-
</div>
67-
68-
<p className="project-card-meta">
69-
<a href={project.repo.href} target="_blank" rel="noreferrer">
70-
{project.repo.label}
71-
</a>
72-
</p>
73-
</article>
74-
))}
75-
</div>
76-
)}
7736
</section>
7837
);
7938
}

src/styles.css

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -264,37 +264,6 @@ p {
264264
background: var(--surface);
265265
}
266266

267-
.tag-row {
268-
display: flex;
269-
flex-wrap: wrap;
270-
gap: 0.6rem;
271-
align-items: center;
272-
}
273-
274-
.tag-row--compact {
275-
gap: 0.5rem;
276-
}
277-
278-
.tag {
279-
display: inline-flex;
280-
align-items: center;
281-
padding: 0.28rem 0.65rem;
282-
border-radius: 999px;
283-
border: 1px solid var(--line);
284-
background: transparent;
285-
color: var(--muted);
286-
font-size: 0.8rem;
287-
letter-spacing: 0.04em;
288-
text-transform: lowercase;
289-
transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
290-
}
291-
292-
.tag--active {
293-
color: var(--text);
294-
border-color: var(--accent);
295-
background-color: var(--hover);
296-
}
297-
298267
.project-list {
299268
display: grid;
300269
gap: 1.25rem;
@@ -499,11 +468,6 @@ p {
499468
border-color: var(--accent);
500469
}
501470

502-
.tag:hover {
503-
color: var(--text);
504-
border-color: var(--accent);
505-
}
506-
507471
.project-title-link:hover {
508472
border-color: var(--text);
509473
}

0 commit comments

Comments
 (0)