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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
!.yarn/plugins
!.yarn/releases
!.yarn/versions
package-lock.json

# testing
/coverage
Expand Down
16 changes: 1 addition & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 3 additions & 32 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Link from "next/link";
import { GithubButton, BookButton } from "@/components/ui/buttons";

async function getOrgData() {
const res = await fetch(`https://api.github.com/orgs/Syobosetsu-Proj`, {
Expand All @@ -15,35 +15,6 @@ async function getOrgData() {
return res.json();
}

export function GithubButton(sublink: string) {
return (
<a
href={`https://github.com/${sublink}`}
target="_blank"
rel="noopener noreferrer"
className="mt-10 py-1.5 px-4 inline-flex items-center justify-center gap-2 transition-colors bg-neutral-800 active:bg-neutral-950 font-medium border-neutral-900 text-white rounded-lg hover:bg-neutral-900 disabled:opacity-50"
>
<img src="/icons/github.svg" alt="GitHub" className="w-5 h-5 filter invert" />

<span>GitHub</span>
</a>
);
}

export function BookButton(link: string, text: string) {
return (
<Link
href={link}
rel="noopener noreferrer"
className="mt-10 py-1.5 px-4 inline-flex items-center justify-center gap-2 transition-colors bg-green-800 active:bg-green-950 font-medium border-green-900 text-white rounded-lg hover:bg-green-900 disabled:opacity-50"
>
<img src="/icons/book.svg" alt="GitHub" className="w-5 h-5 filter invert" />

<span>{text}</span>
</Link>
);
}

export default async function Home() {
const org = await getOrgData();

Expand All @@ -60,8 +31,8 @@ export default async function Home() {
</div>

<div className="flex gap-4 mt-10">
{GithubButton("Syobosetsu-Proj")}
{BookButton("blog", "Blog")}
<GithubButton sublink="Syobosetsu-Proj" />
<BookButton link="blog">Blog</BookButton>
</div>
</div>
</div>
Expand Down
29 changes: 29 additions & 0 deletions src/components/ui/buttons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Link from "next/link";

export function GithubButton({ sublink }: { sublink: string }) {
return (
<a
href={`https://github.com/${sublink}`}
target="_blank"
rel="noopener noreferrer"
className="mt-10 py-1.5 px-4 inline-flex items-center justify-center gap-2 transition-colors bg-neutral-800 active:bg-neutral-950 font-medium border-neutral-900 text-white rounded-lg hover:bg-neutral-900 disabled:opacity-50"
>
<img src="/icons/github.svg" alt="GitHub" className="w-5 h-5 filter invert" />

<span>GitHub</span>
</a>
);
}

export function BookButton({ link, children }: { link: string, children: React.ReactNode }) {
return (
<Link
href={link}
className="mt-10 py-1.5 px-4 inline-flex items-center justify-center gap-2 transition-colors bg-green-800 active:bg-green-950 font-medium border-green-900 text-white rounded-lg hover:bg-green-900 disabled:opacity-50"
>
<img src="/icons/book.svg" alt="Book" className="w-5 h-5 filter invert" />

<span>{children}</span>
</Link>
);
}