Skip to content

ブログページのページネーション実装 - #174

Open
tsuna-soboro wants to merge 7 commits into
mainfrom
172
Open

tsuna-soboro wants to merge 7 commits into
mainfrom
172

Conversation

@tsuna-soboro

Copy link
Copy Markdown
Collaborator

関連issue

#172

@vercel

vercel Bot commented Mar 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
jackweb Ready Ready Preview Oct 13, 2026 1:50pm UTC

@tsuna-soboro
tsuna-soboro marked this pull request as ready for review October 10, 2026 05:29
Comment thread public/Pagination-pc.png Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おそらくこの画像はもう使用していないので,消しておいてもらえるとありがたいです...!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6~9行目のimportはすべてコード内で使用していないみたいなので,消しておいていただけるとありがたいです...!

Comment thread src/screens/Blog/index.tsx Outdated
headingText: string;
};

import { SlArrowRight, SlArrowLeft } from "react-icons/sl";

@kotttto kotttto Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

16行目のimportは,import React from "react";の下においておいてください!
たぶん,「react-icons/sl import should occur before import of @/ui/ArticleItem」というlintのwarningがでているかと思います
もし,表示されていなかったら,VScodeの拡張機能に「ESLint」を追加するといいと思います!

Comment thread src/ui/IconLink/index.tsx

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IconLinkは結局,ページネーションボタンに使用していないと思うので,このファイルの変更はもとにもどしておいてもらえると助かります...!


import { SlArrowRight, SlArrowLeft } from "react-icons/sl";

export const PaginationButton = ({

@kotttto kotttto Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(+α)
18~78行目は別のコンポーネントに分割してほしいです!
具体的な手順としては,
src/ui配下に,PagenationButtonディレクトリを作成し,その中にindex.tsxとindex.module.scssを作成し,ページネーションボタンに関する実装とスタイルを移動させます.
移動させた後は,src/screens/Blog/index.tsxとsrc/screens/Blog/index.module.scssから重複している部分を削除しておいてほしいです...!


{/* 「前へ」のボタンを配置 */}
<button
className={prevButtonDisable ? styles.disabled : ""}

@kotttto kotttto Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(+α)
スマホ画面のサイズのときは,前へと次へのボタンを非表示にしてみてほしいです!(レスポンシブ)
具体的には,
className={prevButtonDisable ? styles.disabled : "styles.prevAndNextButton"}
と変更して,

.prevAndNextButton{
@media (max-width: $mobile) {
display: none
  }
}

のようにするといいかと思います...!
さらに同じような方法で,ボタンの大きさも少し小さめにしておくといいかもです!

onPageChange: (index: number) => void;
}) => {

const pages = Array.from({ length: totalPages }, (_, index) => index + 1);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(+α)
ページ数が6枚以上のとき,「1 2 3 4 ... 6」と表示するようにしてみてほしいです
具体的には,

totalPages >= 6
      ? //「1 2 3 4 ... 6」と表示
      : Array.from({ length: totalPages }, (_, index) => index + 1);

のように条件分岐させるといいと思います!
それができたら,さらに,PC・タブレットとスマホで,「ページ数が6枚以上のとき」という条件を変えてもいいかもしれません!(PC・タブレットはもっと大きい数字にするなど)

This branch was successfully deployed

1 active deployment
Preview — 8ea95b5c Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants