aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/hooks/use-posts-list/use-posts-list.test.ts
Commit message (Collapse)AuthorAgeFilesLines
* test(services): add tests for posts fetchersArmand Philippot2023-11-281-24/+0
|
* refactor(services, types): reorganize GraphQL fetchers and data typesArmand Philippot2023-11-271-2/+2
| | | | | | | | | | | | 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): rewrite PostsList componentArmand Philippot2023-11-131-0/+24
* 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)