aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/recherche
Commit message (Collapse)AuthorAgeFilesLines
* refactor(pages): rewrite helpers to output schema in json-ld formatArmand Philippot2023-12-141-31/+26
| | | | | | | | | | | | | * make sure url are absolutes * nest breadcrumb schema in webpage schema * trim HTML tags from content/description * use a regular script instead of next/script (with the latter the schema is not updated on route change) * place the script in document head * add keywords, wordCount and readingTime keys in BlogPosting schema * fix breadcrumbs in search page (without query) * add tests (a `MatchInlineSnapshot` will be better but Prettier 3 is not supported yet)
* refactor(hooks): rewrite useBreadcrumbs hookArmand Philippot2023-12-121-12/+7
| | | | | | | * use next/router to get the slug instead of using props * handle cases where the current page title is not provided * update JSON-LD schema to match the example in documentation * add tests
* refactor(pages): refine Search pageArmand Philippot2023-12-071-154/+211
| | | | | | | * extract NoResults component to improve readability * provide a different message when the url does not contain a query * use hooks to refresh Thematics and Topics lists * remove useDataFromApi hook
* refactor(pages): refine Blog pagesArmand Philippot2023-12-041-4/+6
| | | | | | | | | | * replace usePostsList with useArticlesList to keep names coherent * remove useIsMounted hook * rewrite useRedirection hook * add redirect in getStaticProps to avoid unecessary fetching * move Pagination component in a noscript tag * use hooks to refresh thematics and topics lists * complete Cypress tests
* fix(pages,services): make thematics & topics pages usable againArmand Philippot2023-11-291-3/+8
| | | | | | | | | | When I refactored the fetchers and convertors in #f111685 I forgot to convert WPThematicPreview and WPTopicPreview so the thematics and topics pages was broken. I also: * removed the ToC added by error in #70b4f63 * fix heading styles * fix website url in topics pages
* refactor(services, types): reorganize GraphQL fetchers and data typesArmand Philippot2023-11-271-29/+28
| | | | | | | | | | | | The Typescript mapped types was useful for autocompletion in fetchers but their are harder to maintain. I think it's better to keep each query close to its fetcher to have a better understanding of the fetched data. So I: * colocate queries with their own fetcher * colocate mutations with their own mutator * remove Typescript mapped types for queries and mutations * move data convertors inside graphql services * rename most of data types and fetchers
* refactor(components): replace PageLayout template with PageArmand Philippot2023-11-201-62/+40
| | | | | | | | | * split pages in smaller components (it is both easier to maintain and more readable, we avoid the use of fragments in pages directory) * extract breadcrumbs from article tag (the navigation is not related to the page contents) * remove useReadingTime hook * remove layout options except `isHome`
* refactor(components): extract MetaItem from MetaListArmand Philippot2023-11-201-24/+23
| | | | | | * replace `items` prop on MetaList with `children` prop: it was too restrictive and the global options was not really useful. It is better too give control to the consumers.
* refactor(hooks): remove useSettings hookArmand Philippot2023-11-151-14/+9
| | | | | | | It does not make sense to re-export an existing object through a hook. On some pages both the hook and the object was imported... It is better to use the CONFIG (previously settings) object directly and by doing it we avoid potential errors because of conditional hooks.
* refactor(components): replace LinksListWidget with LinksWidgetArmand Philippot2023-11-141-6/+6
| | | | | | | * avoid List component repeat * rewrite tests and CSS * add an id to LinksWidgetItemData (previously LinksListItems) type because the label could be duplicated
* refactor(components): rewrite PostsList componentArmand Philippot2023-11-131-15/+54
| | | | | | | | | | | | | | | * remove NoResults component and move logic to Search page * add a usePostsList hook * remove Pagination from PostsList (it is only used if javascript is disabled and not on every posts list) * replace `byYear` prop with `sortByYear` * replace `loadMore` prop with `onLoadMore` * remove `showLoadMoreBtn` (we can use `loadMore` prop instead to determine if we need to display the button) * replace `titleLevel` prop with `headingLvl` * add `firstNewResult` prop to handle focus on the new results when loading more article (we should not focus a useless span but the item directly)
* refactor(hooks): rewrite usePagination hookArmand Philippot2023-11-131-13/+6
| | | | | | | * replace `isLoadingInitialData` with `isLoading` & `isRefreshing` * rename `fallbackData` prop to `fallback` * replace `setSize` return with a `loadMore` callback * add tests
* refactor(components): rewrite SearchForm componentArmand Philippot2023-11-111-1/+0
| | | | | | * remove searchPage prop (the consumer should handle the submit) * change onSubmit type * use `useForm` hook to handle the form
* refactor(components): replace Meta component with MetaListArmand Philippot2023-11-111-1/+24
| | | | | | It removes items complexity by allowing consumers to use any label/value association. Translations should also be defined by the consumer. Each item can now be configured separately (borders, layout...).
* refactor(components): merge HeadingButton and Widget componentsArmand Philippot2023-11-111-8/+15
| | | | | | 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.
* refactor(components): rewrite Notice componentArmand Philippot2023-11-111-2/+3
| | | | * Rename message prop to children prop and set ReactNode as type
* refactor(components): rewrite Spinner componentArmand Philippot2023-10-241-1/+6
| | | | | | | * Message should be set as children * Default message is no longer available (depending on use case, the consumer might prefer aria-label instead) * It is now possible to define the message position
* refactor(routes): replace hardcoded routes with constantsArmand Philippot2023-10-241-20/+34
| | | | | | | | It makes it easier to change a route if needed and it avoid typo mistakes. I also refactored a bit the concerned files to be complient with the new ESlint config. However, I should rewrite the pages to reduce the number of statements.
* refactor: use named export for everything except pagesArmand Philippot2023-09-201-22/+23
| | | | | | 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.
* refactor(build): replace paths aliases with relative pathsArmand Philippot2023-09-191-23/+26
| | | | | | Using paths aliases starting with "@" can be confusing and can lead to conflict with existings modules. I prefer to use relative paths to avoid extra configuration in tools because of these aliases.
* chore: add a search form when posts list prints no resultsArmand Philippot2022-05-241-0/+1
|
* fix: ensure all topics/thematics have the base urlArmand Philippot2022-05-231-4/+4
|
* refactor(schema): use helpers function to avoid repeat between pagesArmand Philippot2022-05-231-32/+17
|
* refactor: reduce the number of data transformationArmand Philippot2022-05-231-70/+6
|
* chore: handle blog pagination when JS is disabledArmand Philippot2022-05-201-0/+1
|
* chore: use persistent layoutArmand Philippot2022-05-171-3/+11
| | | | | It prevents to rerender the common components between pages (header, footer...).
* chore: adjust and complete missing stylesArmand Philippot2022-05-161-11/+1
| | | | | | * add logo to topics pages and links * add Prism styles to articles * and a few other adjustements
* refactor: use custom hook for breadcrumb items and schemaArmand Philippot2022-05-161-16/+6
|
* chore: add Search pageArmand Philippot2022-05-151-0/+324
|
* chore: remove old pages, components, helpers and typesArmand Philippot2022-04-291-213/+0
| | | | | Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch.
* refactor: use formatjs swc pluginArmand Philippot2022-03-231-0/+9
| | | | | I'm not able to configure SWC plugins in Next.js so to make it works, all translation must have an id.
* chore: move pagination cursor title in a separate divArmand Philippot2022-02-011-0/+1
| | | | | | The progress bar will be clearer for everyone if the information about the number of loaded articles is printed without hovering the progress bar.
* refactor(config): move config from config dir to utilsArmand Philippot2022-01-291-7/+7
|
* chore: replace lingui functions with react-intlArmand Philippot2022-01-291-13/+55
|
* chore(i18n): replace i18n provider and helpersArmand Philippot2022-01-291-7/+7
|
* fix: handle translation with linguiArmand Philippot2022-01-281-9/+8
| | | | | | | | The previous method was not working so I tried a different approach. Translation is loaded but I'm still getting warnings: * Plurals for locale undefined aren't loaded * Text content did not match I can't figure how to fix them...
* chore: display a progress bar before load more buttonArmand Philippot2022-01-251-5/+26
| | | | | Since I'm using cursor pagination, users cannot know if there is a lot of posts available. With this cursor, they can verify the progression.
* chore: display total found posts in page metaArmand Philippot2022-01-251-1/+6
|
* chore: add a spinner when content is loadingArmand Philippot2022-01-161-9/+18
|
* chore: update sidebar and widgets stylesArmand Philippot2022-01-151-2/+2
| | | | | | | | | I'm now using a widget that can be expanded/collapsed. It also allows me to handle more effectively widgets overflow and to avoid styles repetitions. However, with stylelint rule "no-descending-specificity", I'm not sure if the stylesheets are really logical... Maybe I should deactivate this rule.
* chore: improve load more button accessibilityArmand Philippot2022-01-141-3/+12
| | | | | | On click, the focus should be moved to the last post in the list instead of keeping it on load more button. It helps to keep a consistent navigation for keyboard users for example.
* chore: change posts list stylesArmand Philippot2022-01-141-2/+10
|
* chore: adjust css grid on listing pages without sidebarArmand Philippot2022-01-071-2/+3
|
* refactor: reuse PostHeader for all pages except homepageArmand Philippot2022-01-061-11/+10
|
* refactor: avoid useless assignement before return statementArmand Philippot2022-01-041-10/+7
|
* chore: add a breadcrumb componentArmand Philippot2021-12-211-3/+6
|
* chore: create search viewArmand Philippot2021-12-201-0/+110