aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/organisms/posts-list/posts-list.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-12-19 17:11:48 +0100
committerArmand Philippot <git@armandphilippot.com>2023-12-19 17:11:48 +0100
commit67ac79f8ba2ea900ec0ac67e56387889ee887a48 (patch)
treefad602f33265f1c2186883ef581973caf517a0aa /src/components/organisms/posts-list/posts-list.tsx
parentfc77c0a7e9c81f5bc1a69dee945ce71b9511b3cc (diff)
fix(layout): refine pagination when JS is disabled
* fix the total number of pages * hide the load more button and the progress bar * remove the informative notice since it is no longer necessary * if the page number is equal to 1, use Blog route directly (NextJS is not able to redirect the user when JS is disabled)
Diffstat (limited to 'src/components/organisms/posts-list/posts-list.tsx')
-rw-r--r--src/components/organisms/posts-list/posts-list.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/components/organisms/posts-list/posts-list.tsx b/src/components/organisms/posts-list/posts-list.tsx
index ad5bed5..91b2e0d 100644
--- a/src/components/organisms/posts-list/posts-list.tsx
+++ b/src/components/organisms/posts-list/posts-list.tsx
@@ -222,7 +222,8 @@ const PostsListWithRef: ForwardRefRenderFunction<
{total ? (
<ProgressBar
aria-label={progressInfo}
- className={styles.progress}
+ // eslint-disable-next-line react/jsx-no-literals
+ className={`${styles.progress} js-only`}
current={posts.length}
isCentered
isLoading={isLoading}
@@ -232,7 +233,8 @@ const PostsListWithRef: ForwardRefRenderFunction<
) : null}
{onLoadMore && (!total || (total && posts.length < total)) ? (
<Button
- className={styles.btn}
+ // eslint-disable-next-line react/jsx-no-literals
+ className={`${styles.btn} js-only`}
isLoading={isLoading}
// eslint-disable-next-line react/jsx-no-literals
kind="tertiary"