aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/recherche
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-01-29 23:38:13 +0100
committerArmand Philippot <git@armandphilippot.com>2022-01-29 23:38:13 +0100
commit82d310403c4bb09bc2f0a204b6374934a10cf348 (patch)
tree488e93e373a7d9215531bb8fcfc37bcbb290d0fa /src/pages/recherche
parentf49dfba86b9ac745ddc374ee0f02f03d7e81d872 (diff)
refactor(config): move config from config dir to utils
Diffstat (limited to 'src/pages/recherche')
-rw-r--r--src/pages/recherche/index.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pages/recherche/index.tsx b/src/pages/recherche/index.tsx
index 857b114..8e4033b 100644
--- a/src/pages/recherche/index.tsx
+++ b/src/pages/recherche/index.tsx
@@ -6,11 +6,11 @@ import PostsList from '@components/PostsList/PostsList';
import Sidebar from '@components/Sidebar/Sidebar';
import Spinner from '@components/Spinner/Spinner';
import { ThematicsList, TopicsList } from '@components/Widgets';
-import { config } from '@config/website';
import { getPublishedPosts } from '@services/graphql/queries';
import styles from '@styles/pages/Page.module.scss';
import { NextPageWithLayout } from '@ts/types/app';
import { PostsList as PostsListData } from '@ts/types/blog';
+import { settings } from '@utils/config';
import { getIntlInstance, loadTranslation } from '@utils/helpers/i18n';
import { GetStaticProps, GetStaticPropsContext } from 'next';
import Head from 'next/head';
@@ -37,9 +37,9 @@ const Search: NextPageWithLayout = () => {
if (previousData && !previousData.posts) return null;
return pageIndex === 0
- ? { first: config.postsPerPage, searchQuery: query }
+ ? { first: settings.postsPerPage, searchQuery: query }
: {
- first: config.postsPerPage,
+ first: settings.postsPerPage,
after: previousData.pageInfo.endCursor,
searchQuery: query,
};
@@ -56,13 +56,13 @@ const Search: NextPageWithLayout = () => {
}, [data]);
const [loadedPostsCount, setLoadedPostsCount] = useState<number>(
- config.postsPerPage
+ settings.postsPerPage
);
useEffect(() => {
if (data && data.length > 0) {
const newCount =
- config.postsPerPage +
+ settings.postsPerPage +
data[0].pageInfo.total -
data[data.length - 1].pageInfo.total;
setLoadedPostsCount(newCount);
@@ -102,11 +102,11 @@ const Search: NextPageWithLayout = () => {
defaultMessage: 'Search for a post on {websiteName}',
description: 'SearchPage: meta description without query',
},
- { websiteName: config.name }
+ { websiteName: settings.name }
);
const head = {
- title: `${title} | ${config.name}`,
+ title: `${title} | ${settings.name}`,
description,
};