aboutsummaryrefslogtreecommitdiffstats
path: root/src/types
Commit message (Collapse)AuthorAgeFilesLines
* refactor(pages): refine Contact pageArmand Philippot2023-12-112-6/+0
| | | | | | | * remove next/router dependency * remove pageTitle since it is defined in MDX * reduce statements by grouping messages * mock response with MSW and add test for sendEmail
* refactor(hooks): replace useGithubApi with useGithubRepoMetaArmand Philippot2023-12-071-1/+7
| | | | | | | | * use GraphQL API instead of REST (the inconvenient however is that we now need an authorization token...) * move fetcher in services * add tests * mock response using MSW
* refactor(pages): refine Projects pageArmand Philippot2023-12-071-1/+2
| | | | | | | * add a `contexts` meta key to projects * replace `technologies` with `contexts` key in projects list * make getProjectsFilenames async * add Cypress tests
* refactor(pages): refine Thematic pagesArmand Philippot2023-12-012-0/+3
| | | | | | | | | | | * add a table of contents (however posts heading are not included) * rename posts list section title * add a useThematic hook to refresh thematic contents * add a useThematicLists hook to refresh thematics list * add a `notIn` filter in thematics list fetcher to directly remove unwanted thematics * add Cypress tests
* fix(pages,services): make thematics & topics pages usable againArmand Philippot2023-11-291-4/+4
| | | | | | | | | | 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
* fix(services,types): make queries and types coherent for TopicArmand Philippot2023-11-281-1/+1
| | | | | | * some nodes was missing in topicQuery * a node was mispelled in topicsListQuery * add tests for all topics fetchers
* fix(services,types): make coherent Thematic type and queryArmand Philippot2023-11-281-10/+8
| | | | | | * some nodes was queried but missing in the Thematic type and vice versa, it is now fixed * add tests for all thematics fetchers
* refactor(services, types): reorganize GraphQL fetchers and data typesArmand Philippot2023-11-2710-469/+364
| | | | | | | | | | | | 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-2/+0
| | | | | | | | | * 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): replace Overview with ProjectOverview componentArmand Philippot2023-11-111-0/+7
| | | | | | * `cover` prop is now expecting a ReactElement (NextImage) * `meta` prop is now limited to a specific set of meta items * add a `name` prop to add an accessible name to the figure element
* feat(hooks): add an useForm hookArmand Philippot2023-11-112-0/+6
| | | | | | | | | * add two "sub"-hooks: useFormValues and useFormSubmit (that can be used independently) * handle initial data * handle custom submit callback * handle data validation * handle submit status
* refactor(providers,hooks): rewrite PrismThemeProvider & usePrismThemeArmand Philippot2023-11-111-0/+3
| | | | | | * reuse Theme provider logic * move DOM mutation from provider to hook * add a script to init theme before page load
* refactor(hooks,providers): rewrite useAckee hook and AckeeProviderArmand Philippot2023-11-111-0/+2
|
* refactor(hooks): rewrite useLocalStorage hookArmand Philippot2023-11-111-0/+2
| | | | | | | * return a tuple instead of an object * add a validator function as parameter (if the stored value is manually changed, it is not safe to cast its type) * add tests
* refactor(components): rewrite List componentArmand Philippot2023-11-111-0/+3
| | | | | | | | | * change `items` prop to children * replace `kind` prop with `isHierarchical`, `isOrdered` & `isInline` props * add `hideMarker` prop * add `spacing` prop to control item spacing * move lists styles to Sass placeholders to avoid repeats because of headless WordPress
* refactor(components): rewrite Spinner componentArmand Philippot2023-10-241-7/+9
| | | | | | | * 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: use named export for everything except pagesArmand Philippot2023-09-204-10/+13
| | | | | | 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-197-0/+503
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.