aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/recherche/index.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-06 18:15:18 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-06 18:15:18 +0100
commitc3b438a5252e8c8897c868cdda8377e3162fdd69 (patch)
treed0b730c1b3cc971a7ceae02312988071577a368a /src/pages/recherche/index.tsx
parentb9c1953c79688fc3f536b7927692309c9780b5da (diff)
refactor: reuse PostHeader for all pages except homepage
Diffstat (limited to 'src/pages/recherche/index.tsx')
-rw-r--r--src/pages/recherche/index.tsx21
1 files changed, 10 insertions, 11 deletions
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 && (