aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/recherche
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-05-17 22:48:41 +0200
committerArmand Philippot <git@armandphilippot.com>2022-05-17 22:48:41 +0200
commit271ef6debaca7ed9a01829dcef3a37e90a2dff05 (patch)
treeaa1513b40e7020a44cfcaaedc3a33d39ecfb8af7 /src/pages/recherche
parent4e53a8654441481029746ff4e35a4a19c8d83709 (diff)
chore: use persistent layout
It prevents to rerender the common components between pages (header, footer...).
Diffstat (limited to 'src/pages/recherche')
-rw-r--r--src/pages/recherche/index.tsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/pages/recherche/index.tsx b/src/pages/recherche/index.tsx
index d88a293..09091c8 100644
--- a/src/pages/recherche/index.tsx
+++ b/src/pages/recherche/index.tsx
@@ -2,6 +2,7 @@ import Notice from '@components/atoms/layout/notice';
import Spinner from '@components/atoms/loaders/spinner';
import PostsList, { type Post } from '@components/organisms/layout/posts-list';
import LinksListWidget from '@components/organisms/widgets/links-list-widget';
+import { getLayout } from '@components/templates/layout/layout';
import PageLayout from '@components/templates/page/page-layout';
import { type EdgesResponse } from '@services/graphql/api';
import {
@@ -14,7 +15,11 @@ import {
getTotalThematics,
} from '@services/graphql/thematics';
import { getTopicsPreview, getTotalTopics } from '@services/graphql/topics';
-import { type Article, type Meta } from '@ts/types/app';
+import {
+ type Article,
+ type Meta,
+ type NextPageWithLayout,
+} from '@ts/types/app';
import {
RawThematicPreview,
RawTopicPreview,
@@ -29,7 +34,7 @@ import useBreadcrumb from '@utils/hooks/use-breadcrumb';
import useDataFromAPI from '@utils/hooks/use-data-from-api';
import usePagination from '@utils/hooks/use-pagination';
import useSettings from '@utils/hooks/use-settings';
-import { GetStaticProps, NextPage } from 'next';
+import { GetStaticProps } from 'next';
import Head from 'next/head';
import { useRouter } from 'next/router';
import Script from 'next/script';
@@ -45,7 +50,7 @@ type SearchPageProps = {
/**
* Search page.
*/
-const SearchPage: NextPage<SearchPageProps> = ({
+const SearchPage: NextPageWithLayout<SearchPageProps> = ({
thematicsList,
topicsList,
}) => {
@@ -283,6 +288,9 @@ const SearchPage: NextPage<SearchPageProps> = ({
);
};
+SearchPage.getLayout = (page) =>
+ getLayout(page, { useGrid: true, withExtraPadding: true });
+
export const getStaticProps: GetStaticProps<SearchPageProps> = async ({
locale,
}) => {