From f861e6a269ba9f62700776d3cd13b644a9e836d4 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 20 Sep 2023 16:38:54 +0200 Subject: refactor: use named export for everything except pages Next expect a default export for pages so only those components should use default exports. Everything else should use named exports to reduce the number of import statements. --- src/pages/blog/index.tsx | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'src/pages/blog/index.tsx') diff --git a/src/pages/blog/index.tsx b/src/pages/blog/index.tsx index 1f88588..13a4c57 100644 --- a/src/pages/blog/index.tsx +++ b/src/pages/blog/index.tsx @@ -3,42 +3,39 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import Script from 'next/script'; import { useIntl } from 'react-intl'; -import Notice from '../../components/atoms/layout/notice'; -import PostsList 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 { getArticles, getTotalArticles } from '../../services/graphql/articles'; import { - getThematicsPreview, - getTotalThematics, -} from '../../services/graphql/thematics'; + getLayout, + LinksListWidget, + Notice, + PageLayout, + PostsList, +} from '../../components'; import { + getArticles, + getThematicsPreview, getTopicsPreview, + getTotalArticles, + getTotalThematics, getTotalTopics, -} from '../../services/graphql/topics'; -import { type NextPageWithLayout } from '../../types/app'; -import { EdgesResponse } from '../../types/graphql/queries'; +} from '../../services/graphql'; import { + type EdgesResponse, + type NextPageWithLayout, type RawArticle, type RawThematicPreview, type RawTopicPreview, -} from '../../types/raw-data'; +} from '../../types'; import { settings } from '../../utils/config'; -import { loadTranslation, type Messages } from '../../utils/helpers/i18n'; import { + getBlogSchema, getLinksListItems, getPageLinkFromRawData, getPostsList, -} from '../../utils/helpers/pages'; -import { - getBlogSchema, getSchemaJson, getWebPageSchema, -} from '../../utils/helpers/schema-org'; -import useBreadcrumb from '../../utils/hooks/use-breadcrumb'; -import usePagination from '../../utils/hooks/use-pagination'; -import useSettings from '../../utils/hooks/use-settings'; +} from '../../utils/helpers'; +import { loadTranslation, type Messages } from '../../utils/helpers/server'; +import { useBreadcrumb, usePagination, useSettings } from '../../utils/hooks'; type BlogPageProps = { articles: EdgesResponse; -- cgit v1.2.3