Skip to content

Commit a032f67

Browse files
authored
feat(docs): add contributors page (#70)
1 parent f5fa928 commit a032f67

File tree

5 files changed

+61
-2
lines changed

5 files changed

+61
-2
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
async function getContributors() {
2+
"use cache";
3+
4+
try {
5+
const res = await fetch(
6+
"https://api.github.com/repos/lazarv/react-server/contributors"
7+
);
8+
const data = await res.json();
9+
return data.filter((contributor) => contributor.login !== "lazarv");
10+
} catch {
11+
return [];
12+
}
13+
}
14+
15+
export default async function Contributors() {
16+
const contributors = await getContributors();
17+
18+
return (
19+
<div className="w-full my-8 flex flex-wrap gap-8 justify-center items-center">
20+
{contributors.map((contributor) => (
21+
<a
22+
key={contributor.login}
23+
href={`https://github.com/${contributor.login}`}
24+
target="_blank"
25+
rel="noopener noreferrer"
26+
className="flex flex-col items-center gap-2"
27+
>
28+
<img
29+
src={contributor.avatar_url}
30+
alt={contributor.login}
31+
className="w-24 h-24 rounded-full outline outline-4 outline-indigo-500 dark:outline-yellow-600"
32+
/>
33+
<div className="text-sm font-semibold">{contributor.login}</div>
34+
</a>
35+
))}
36+
</div>
37+
);
38+
}

docs/src/components/NavigationLinks.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default function NavigationLinks({ prev, next }) {
22
return (
3-
<div className="flex flex-wrap gap-2 md:flex-row md:justify-between">
3+
<div className="w-full flex flex-wrap gap-2 md:flex-row md:justify-between">
44
{prev && (
55
<a
66
href={prev.href}

docs/src/components/Sidebar.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ article ~ .root {
112112
pointer-events: auto;
113113
/* view-transition-name: sidebar; */
114114

115+
&:has(nav:empty) {
116+
@apply hidden;
117+
}
118+
115119
@media (prefers-reduced-motion) {
116120
view-transition-name: none;
117121
}

docs/src/components/TableOfContents.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default function TableOfContents() {
8181
};
8282
}, []);
8383

84-
if (tableOfContents.length === 1) return null;
84+
if (tableOfContents.length < 2) return null;
8585

8686
return (
8787
<>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Contributors
3+
category: Team
4+
order: 1
5+
slug: team/contributors
6+
---
7+
8+
import Contributors from "../../../../components/Contributors";
9+
10+
<div className="container text-center max-w-xl mx-auto [&>h1]:text-4xl [&>p]:text-lg [&>p]:text-gray-700 dark:[&>p]:text-gray-400">
11+
# Contributors
12+
13+
A big shoutout to all the amazing contributors who’ve rolled up their sleeves, shared their skills, and helped level up this project! Your input has truly made an impact—thank you!
14+
15+
</div>
16+
17+
<Contributors />

0 commit comments

Comments
 (0)