ブログ一覧ページにもバックボタンを追加#5
Conversation
|
@tanahiro2010 is attempting to deploy a commit to the t-b-t-nchos Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. WalkthroughBlogページとブログポストページにBackButtonUIコンポーネントを統合。新しいBackButtonコンポーネントをsrc/components/ui/buttons.tsxに追加し、useRouterを使用してナビゲーション機能を実装。既存のLinkベースのバック機能をコンポーネント化。 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
ブログ一覧にスタイリッシュな「戻る」ボタンを追加
概要
ブログ一覧ページ(
src/app/blog/page.tsx)の上部に、視認性と操作性を高めるカスタムBackButtonを追加しました。ボタンはクライアントコンポーネントとして実装し、前のページに戻る(履歴がなければ Next.js の挙動に従う)か、
hrefが指定されている場合はそのパスへ遷移します。変更点(主なファイル)
src/components/ui/buttons.tsxBackButtonをリデザインして実装(アイコン、ホバー効果、a11y 属性、href?: stringとlabel?: stringをサポート)。GithubButton/BookButtonはそのまま利用可能。src/app/blog/page.tsxBackButtonを挿入。動作
router.back())。hrefを渡すとrouter.push(href)で指定先に移動。button要素を使用し、aria-labelを設定。キーボード操作にも対応。検証
npx tsc --noEmit(エラーなし)QA 手順(レビュアー向け)
http://localhost:3000/blogを開く。<BackButton href="/" />等で遷移を確認)。注意点 / 影響範囲
buttons.tsxをクライアントコンポーネント化したため、このファイル内のコンポーネントはクライアント側でのみ使用することを想定しています。サーバーコンポーネントから直接使用する場合はラップや確認が必要です。GithubButton/BookButtonに動作の変更はありません。追加提案(任意)
<BackButton href="/" label="Home" />のようにhrefを渡すことを推奨します。Summary by CodeRabbit
リリースノート