Skip to content

Commit

Permalink
feat(docs): add contributors page (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarv authored Nov 8, 2024
1 parent f5fa928 commit a032f67
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 2 deletions.
38 changes: 38 additions & 0 deletions docs/src/components/Contributors.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
async function getContributors() {
"use cache";

try {
const res = await fetch(
"https://api.github.com/repos/lazarv/react-server/contributors"
);
const data = await res.json();
return data.filter((contributor) => contributor.login !== "lazarv");
} catch {
return [];
}
}

export default async function Contributors() {
const contributors = await getContributors();

return (
<div className="w-full my-8 flex flex-wrap gap-8 justify-center items-center">
{contributors.map((contributor) => (
<a
key={contributor.login}
href={`https://github.com/${contributor.login}`}
target="_blank"
rel="noopener noreferrer"
className="flex flex-col items-center gap-2"
>
<img
src={contributor.avatar_url}
alt={contributor.login}
className="w-24 h-24 rounded-full outline outline-4 outline-indigo-500 dark:outline-yellow-600"
/>
<div className="text-sm font-semibold">{contributor.login}</div>
</a>
))}
</div>
);
}
2 changes: 1 addition & 1 deletion docs/src/components/NavigationLinks.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function NavigationLinks({ prev, next }) {
return (
<div className="flex flex-wrap gap-2 md:flex-row md:justify-between">
<div className="w-full flex flex-wrap gap-2 md:flex-row md:justify-between">
{prev && (
<a
href={prev.href}
Expand Down
4 changes: 4 additions & 0 deletions docs/src/components/Sidebar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ article ~ .root {
pointer-events: auto;
/* view-transition-name: sidebar; */

&:has(nav:empty) {
@apply hidden;
}

@media (prefers-reduced-motion) {
view-transition-name: none;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/TableOfContents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default function TableOfContents() {
};
}, []);

if (tableOfContents.length === 1) return null;
if (tableOfContents.length < 2) return null;

return (
<>
Expand Down
17 changes: 17 additions & 0 deletions docs/src/pages/en/(pages)/team/contributors.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Contributors
category: Team
order: 1
slug: team/contributors
---

import Contributors from "../../../../components/Contributors";

<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">
# Contributors

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!

</div>

<Contributors />

0 comments on commit a032f67

Please sign in to comment.