mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
fix: hide pagination when there's only 1 page
This commit is contained in:
@@ -36,6 +36,8 @@ const next = pageNum < totalPages ? "" : "disabled";
|
|||||||
</ul>
|
</ul>
|
||||||
</Main>
|
</Main>
|
||||||
|
|
||||||
|
{
|
||||||
|
totalPages > 1 && (
|
||||||
<nav class="pagination-wrapper" aria-label="Pagination">
|
<nav class="pagination-wrapper" aria-label="Pagination">
|
||||||
<LinkButton
|
<LinkButton
|
||||||
disabled={prev === "disabled"}
|
disabled={prev === "disabled"}
|
||||||
@@ -44,9 +46,7 @@ const next = pageNum < totalPages ? "" : "disabled";
|
|||||||
ariaLabel="Previous"
|
ariaLabel="Previous"
|
||||||
>
|
>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class={`${prev}-svg`}>
|
<svg xmlns="http://www.w3.org/2000/svg" class={`${prev}-svg`}>
|
||||||
<path
|
<path d="M12.707 17.293 8.414 13H18v-2H8.414l4.293-4.293-1.414-1.414L4.586 12l6.707 6.707z" />
|
||||||
d="M12.707 17.293 8.414 13H18v-2H8.414l4.293-4.293-1.414-1.414L4.586 12l6.707 6.707z"
|
|
||||||
></path>
|
|
||||||
</svg>
|
</svg>
|
||||||
Prev
|
Prev
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
@@ -58,13 +58,13 @@ const next = pageNum < totalPages ? "" : "disabled";
|
|||||||
>
|
>
|
||||||
Next
|
Next
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class={`${next}-svg`}>
|
<svg xmlns="http://www.w3.org/2000/svg" class={`${next}-svg`}>
|
||||||
<path
|
<path d="m11.293 17.293 1.414 1.414L19.414 12l-6.707-6.707-1.414 1.414L15.586 11H6v2h9.586z" />
|
||||||
d="m11.293 17.293 1.414 1.414L19.414 12l-6.707-6.707-1.414 1.414L15.586 11H6v2h9.586z"
|
|
||||||
></path>
|
|
||||||
</svg>
|
</svg>
|
||||||
</LinkButton>
|
</LinkButton>
|
||||||
</nav>
|
</nav>
|
||||||
<Footer noMarginTop />
|
)
|
||||||
|
}
|
||||||
|
<Footer noMarginTop={totalPages > 1} />
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user