diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-06 17:48:03 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:14:41 +0100 |
| commit | 12a03a9a72f7895d571dbaeeb245d92aa277a610 (patch) | |
| tree | 41b6b07928e4f5e101b7ea5d8389bb4325bbac76 /src/pages/recherche/index.tsx | |
| parent | fb860884857da73ee5b5e897745301cdf1d770a2 (diff) | |
refactor(components): merge HeadingButton and Widget components
The HeadingButton component was only used inside Widget component and
it is not very useful on its own so I merge the two components in a
new Collapsible component.
Diffstat (limited to 'src/pages/recherche/index.tsx')
| -rw-r--r-- | src/pages/recherche/index.tsx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/pages/recherche/index.tsx b/src/pages/recherche/index.tsx index 54244b1..f47e40c 100644 --- a/src/pages/recherche/index.tsx +++ b/src/pages/recherche/index.tsx @@ -7,6 +7,7 @@ import { useCallback } from 'react'; import { useIntl } from 'react-intl'; import { getLayout, + Heading, LinksListWidget, Notice, PageLayout, @@ -183,24 +184,30 @@ const SearchPage: NextPageWithLayout<SearchPageProps> = ({ headerMeta={{ total: totalArticles }} widgets={[ <LinksListWidget - // eslint-disable-next-line react/jsx-no-literals -- Key allowed - key="thematics-list" + heading={ + <Heading isFake level={3}> + {thematicsListTitle} + </Heading> + } items={getLinksListItems( thematicsList.map((thematic) => getPageLinkFromRawData(thematic, 'thematic') ) )} - title={thematicsListTitle} - level={2} + // eslint-disable-next-line react/jsx-no-literals -- Key allowed + key="thematics-list" />, <LinksListWidget - // eslint-disable-next-line react/jsx-no-literals -- Key allowed - key="topics-list" + heading={ + <Heading isFake level={3}> + {topicsListTitle} + </Heading> + } items={getLinksListItems( topicsList.map((topic) => getPageLinkFromRawData(topic, 'topic')) )} - title={topicsListTitle} - level={2} + // eslint-disable-next-line react/jsx-no-literals -- Key allowed + key="topics-list" />, ]} > |
