样式微调

This commit is contained in:
tangly1024
2022-04-12 13:27:31 +08:00
parent e3ebc004d1
commit 4c9e84e11d
3 changed files with 8 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ import BlogPostListEmpty from './BlogPostListEmpty'
*/
const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE)
const showPagination = posts.length === BLOG.POSTS_PER_PAGE
const showPagination = postCount >= BLOG.POSTS_PER_PAGE
if (!posts || posts.length === 0) {
return <BlogPostListEmpty />
@@ -26,7 +26,7 @@ const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
<BlogPostCard key={post.id} post={post} />
))}
</div>
{showPagination && <PaginationNumber page={page} totalPage={totalPage} /> }
{showPagination && <PaginationNumber page={page} totalPage={totalPage} />}
</div>
)
}