From 67ac79f8ba2ea900ec0ac67e56387889ee887a48 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 19 Dec 2023 17:11:48 +0100
Subject: 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)
---
 src/components/templates/layout/layout.tsx | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'src/components/templates/layout/layout.tsx')

diff --git a/src/components/templates/layout/layout.tsx b/src/components/templates/layout/layout.tsx
index 16c9180..19cefce 100644
--- a/src/components/templates/layout/layout.tsx
+++ b/src/components/templates/layout/layout.tsx
@@ -1,3 +1,4 @@
+import Head from 'next/head';
 import {
   useRef,
   type FC,
@@ -53,6 +54,16 @@ export const Layout: FC<LayoutProps> = ({ children, isHome }) => {
 
   return (
     <>
+      <Head>
+        <noscript>
+          <style>
+            {/* eslint-disable-next-line react/jsx-no-literals */}
+            {`.js-only {
+                display: none !important;
+              }`}
+          </style>
+        </noscript>
+      </Head>
       <span id={topId} ref={topRef} tabIndex={-1} />
       <noscript>
         <div className={styles['noscript-spacing']} />
-- 
cgit v1.2.3

