From ee002eafdb3dee41f91bf93940e25641d706e80d Mon Sep 17 00:00:00 2001 From: tanahiro2010 Date: Thu, 30 Oct 2025 17:29:16 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20|=20Back=20link=20tag?= =?UTF-8?q?=20to=20BackButton=20component.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/blog/[slug]/page.tsx | 7 +++---- src/components/ui/buttons.tsx | 8 ++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/app/blog/[slug]/page.tsx b/src/app/blog/[slug]/page.tsx index 4c91bc1..936065f 100644 --- a/src/app/blog/[slug]/page.tsx +++ b/src/app/blog/[slug]/page.tsx @@ -1,8 +1,9 @@ import { getAllPosts, getPostBySlug } from "@/lib/posts"; +import { BackButton } from "@/components/ui/buttons"; +import { notFound } from 'next/navigation'; import { remark } from "remark"; import html from "remark-html"; import Link from "next/link"; -import { notFound } from 'next/navigation'; type Props = { params: Promise<{ slug: string }>; @@ -46,9 +47,7 @@ export default async function PostPage({ params }: Props) { /> diff --git a/src/components/ui/buttons.tsx b/src/components/ui/buttons.tsx index 06c9919..e0340d4 100644 --- a/src/components/ui/buttons.tsx +++ b/src/components/ui/buttons.tsx @@ -26,4 +26,12 @@ export function BookButton({ link, children }: { link: string, children: React.R {children} ); +} + +export function BackButton({ link }: { link: string }) { + return ( + + → Back + + ); } \ No newline at end of file From f8e92eb5207ae1624d12197d6964a6ea51a7f567 Mon Sep 17 00:00:00 2001 From: tanahiro2010 Date: Thu, 30 Oct 2025 17:37:06 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=A7=20|=20Changed=20the=20BackButt?= =?UTF-8?q?on=20link=20from=20argument=20specification=20to=20the=20standa?= =?UTF-8?q?rd=20JavaScript=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ui/buttons.tsx | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/components/ui/buttons.tsx b/src/components/ui/buttons.tsx index e0340d4..c99b3f2 100644 --- a/src/components/ui/buttons.tsx +++ b/src/components/ui/buttons.tsx @@ -1,4 +1,7 @@ +"use client"; import Link from "next/link"; +import { useRouter } from "next/navigation"; +import React from "react"; export function GithubButton({ sublink }: { sublink: string }) { return ( @@ -15,7 +18,7 @@ export function GithubButton({ sublink }: { sublink: string }) { ); } -export function BookButton({ link, children }: { link: string, children: React.ReactNode }) { +export function BookButton({ link, children }: { link: string; children: React.ReactNode }) { return ( { + e.preventDefault(); + if (href) { + router.push(href); + } else { + router.back(); + } + }; + return ( - - → Back - + ); } \ No newline at end of file From 4442630c561f951215c9cc295f4116ab8c7446a9 Mon Sep 17 00:00:00 2001 From: tanahiro2010 Date: Thu, 30 Oct 2025 17:37:42 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20|=20Remove=20back=20ur?= =?UTF-8?q?l=20arg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/blog/[slug]/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/blog/[slug]/page.tsx b/src/app/blog/[slug]/page.tsx index 936065f..91a3809 100644 --- a/src/app/blog/[slug]/page.tsx +++ b/src/app/blog/[slug]/page.tsx @@ -47,7 +47,7 @@ export default async function PostPage({ params }: Props) { />
- +
From fcd01bd38d27f52249a1c52034163a392e7dd530 Mon Sep 17 00:00:00 2001 From: tanahiro2010 Date: Thu, 30 Oct 2025 17:38:13 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9C=A8=EF=B8=8F=20|=20Add=20BackButton?= =?UTF-8?q?=20to=20blog=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/blog/page.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/blog/page.tsx b/src/app/blog/page.tsx index ddd483b..e6751f4 100644 --- a/src/app/blog/page.tsx +++ b/src/app/blog/page.tsx @@ -1,6 +1,6 @@ -import Link from "next/link"; -import Image from "next/image"; import { getAllPosts } from "@/lib/posts"; +import { BackButton } from "@/components/ui/buttons"; +import Link from "next/link"; export default async function BlogPage() { const posts = getAllPosts(); @@ -8,6 +8,9 @@ export default async function BlogPage() { return (
+
+ +
    {posts.map((post) => ( @@ -36,6 +39,8 @@ export default async function BlogPage() { ))}
+ +
); } From 4d6180ae4ff0414a18dae492561a7e508b80f5ba Mon Sep 17 00:00:00 2001 From: tanahiro2010 Date: Thu, 30 Oct 2025 17:46:49 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=A7=20|=20Remove=20hover=20animeti?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ui/buttons.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ui/buttons.tsx b/src/components/ui/buttons.tsx index c99b3f2..9893a83 100644 --- a/src/components/ui/buttons.tsx +++ b/src/components/ui/buttons.tsx @@ -47,7 +47,7 @@ export function BackButton({ href, label = "Back" }: { href?: string; label?: st