From c3b438a5252e8c8897c868cdda8377e3162fdd69 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Thu, 6 Jan 2022 18:15:18 +0100
Subject: refactor: reuse PostHeader for all pages except homepage

---
 src/pages/recherche/index.tsx | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

(limited to 'src/pages/recherche/index.tsx')

diff --git a/src/pages/recherche/index.tsx b/src/pages/recherche/index.tsx
index c1ea0d3..5fe35a1 100644
--- a/src/pages/recherche/index.tsx
+++ b/src/pages/recherche/index.tsx
@@ -1,5 +1,6 @@
 import { Button } from '@components/Buttons';
 import { getLayout } from '@components/Layouts/Layout';
+import PostHeader from '@components/PostHeader/PostHeader';
 import PostsList from '@components/PostsList/PostsList';
 import { config } from '@config/website';
 import { t } from '@lingui/macro';
@@ -57,6 +58,14 @@ const Search: NextPageWithLayout = () => {
 
   const hasNextPage = data && data[data.length - 1].pageInfo.hasNextPage;
 
+  const title = query
+    ? t`Search results for: ${query}`
+    : t({
+        id: 'msg.search',
+        comment: 'Search page title',
+        message: 'Search',
+      });
+
   return (
     <>
       <Head>
@@ -64,17 +73,7 @@ const Search: NextPageWithLayout = () => {
         <meta name="description" content={head.description} />
       </Head>
       <article>
-        <header>
-          <h1>
-            {query
-              ? t`Search results for: ${query}`
-              : t({
-                  id: 'msg.search',
-                  comment: 'Search page title',
-                  message: 'Search',
-                })}
-          </h1>
-        </header>
+        <PostHeader title={title} />
         <div>
           <PostsList data={data} showYears={false} />
           {hasNextPage && (
-- 
cgit v1.2.3

