aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages
Commit message (Collapse)AuthorAgeFilesLines
* refactor(providers,hooks): rewrite PrismThemeProvider & usePrismThemeArmand Philippot2023-11-112-3/+21
| | | | | | * reuse Theme provider logic * move DOM mutation from provider to hook * add a script to init theme before page load
* feat: replace next-themes with a custom ThemeProviderArmand Philippot2023-11-112-4/+12
| | | | | | | To be honest, next-themes was working fine. However since I use a theme provider for Prism code blocks, some code is duplicated between this app and the library. So I prefer to use a custom Provider without the options I don't need.
* refactor(hooks,provider): move reduce motion setterArmand Philippot2023-11-112-14/+49
| | | | | | | | | | Since the local storage key is not meant to change between the components, it should be set directly inside the app file. So both the local storage and the data attribute should be handle in a provider. I also added a custom document because we need a script to retrieve the stored value in local storage earlier to avoid flashing on hydration.
* refactor(hooks,providers): rewrite useAckee hook and AckeeProviderArmand Philippot2023-11-111-4/+10
|
* refactor(components): rewrite NavList componentArmand Philippot2023-11-112-2/+2
| | | | | | | * extract NavItem from NavList * remove `kind` and `listClassName` props (since the consumer has control over NavList, NavItem and NavLink components these props are obsolete)
* feat(components): add a generic Grid componentArmand Philippot2023-11-113-19/+56
| | | | | * merge Columns, Gallery and CardsList into Grid component * add more options to control the grid
* refactor(components): rewrite Card componentArmand Philippot2023-11-112-31/+100
| | | | | | | | | | | | | * make the component more generic * merge `<Summary />` and `<Comment />` styles into card component to avoid repeating the same structure * remove most of the props to use composition However the CSS is a bit complex because of the two variants... Also, the component should be refactored when the CSS pseudo-class `:has` has enough support: the provider and the `cover` and `meta` props should be removed.
* refactor(components): rewrite Code component and usePrism hookArmand Philippot2023-11-111-8/+20
| | | | | | | | | | | | * move Prism styles to Sass placeholders to avoid repeats * let usePrism consumer define its plugins (remove default ones) * remove `plugins` prop from Code component * add new props to Code component to let consumer configure plugins (and handle plugin list from the given options) However there are some problems with Prism plugins: line-highlight and treeview does not seems to be loaded. I don't want to use Babel instead of SWC so I have no solution for now.
* feat(components): add a Time componentArmand Philippot2023-11-117-104/+23
| | | | | | Instead of using helpers functions to format the date each time we need to use a time element, it makes more sense to create a new component dedicated to this task.
* refactor(components): replace Meta component with MetaListArmand Philippot2023-11-1111-95/+552
| | | | | | 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): replace ResponsiveImage with Figure componentArmand Philippot2023-11-115-10/+26
| | | | | | | | The styles applied to ResponsiveImage are related to the figure and figcaption elements. Those elements could be use with other contents than images. So I extracted them in a Figure component. The ResponsiveImage component is no longer useful: the consumer should use the Image component from `next` and wrap it in a link if needed.
* refactor(components): merge HeadingButton and Widget componentsArmand Philippot2023-11-118-54/+103
| | | | | | 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 SocialLink componentArmand Philippot2023-11-113-15/+89
| | | | | * replace default label with a label prop * rename name prop to icon prop
* refactor(components): rewrite Link componentArmand Philippot2023-11-111-2/+2
| | | | | | | | | * rename `external` prop to `isExternal` * rename `download` prop to `isDownload` * rewrite CSS to reduce code length and complexity * move link styles in Sass placeholders to avoid repeats because of WordPress articles * move NavLink component to molecules
* refactor(components): rewrite Notice componentArmand Philippot2023-11-113-9/+9
| | | | * Rename message prop to children prop and set ReactNode as type
* refactor(components): rewrite List componentArmand Philippot2023-11-113-72/+89
| | | | | | | | | * 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-243-3/+19
| | | | | | | * 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
* feat(components): replace icons with a generic Icon componentArmand Philippot2023-10-241-5/+3
| | | | | Sizes are also predefined and can be set using the `size` prop, so the consumers should no longer adjust the size in CSS.
* refactor(components): rewrite Heading componentArmand Philippot2023-10-242-2/+124
| | | | | | | | | * remove `alignment` and `withMargin` props (consumer should handle that) * move styles to Sass placeholders to avoid repeats with headings coming from WordPress * refactor some other components that depend on Heading to avoid ESlint errors
* refactor(components): rewrite Section componentArmand Philippot2023-10-241-19/+10
| | | | | | * Make it compliant with ESlint rules * Remove mandatory heading, it now depends on the consumer * Change defaults for hasBorder and variant
* refactor(components): rewrite Button and ButtonLink componentsArmand Philippot2023-10-242-17/+15
| | | | | | | | | | | | | | Both: * move styles to Sass placeholders Button: * add `isPressed` prop to Button * add `isLoading` prop to Button (to differentiate state from disabled) ButtonLink: * replace `external` prop with `isExternal` prop * replace `href` prop with `to` prop
* refactor(routes): replace hardcoded routes with constantsArmand Philippot2023-10-2413-425/+518
| | | | | | | | 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(components): rewrite form componentsArmand Philippot2023-10-242-8/+10
|
* refactor: use named export for everything except pagesArmand Philippot2023-09-2017-233/+231
| | | | | | 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.
* build(deps): bump all dependenciesArmand Philippot2023-09-195-38/+88
| | | | | * MDX type has changed so some components props had to be updated * Since Storybook now supports TS, I renamed the main/preview files
* refactor(build): replace paths aliases with relative pathsArmand Philippot2023-09-1917-279/+293
| | | | | | 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: make Links and Images compliant with Next.js 13Armand Philippot2023-01-235-206/+243
|
* fix(projects): load content dynamically and refresh table of contentsArmand Philippot2022-09-211-2/+7
| | | | | | | The previous way of handling content import was causing issue. So I use dynamic import instead. However, the table of contents was not displayed because the wrapper is first empty. I added a mutation observer to refresh the table of contents when the body is updated.
* fix(types): add custom types to pageProps with translationArmand Philippot2022-09-211-2/+3
|
* fix(projects): do not transform pre to Code componentArmand Philippot2022-08-211-1/+0
| | | | | Sometimes it is useful to display some preformatted data that are not code.
* fix(comments): load all comments on a postArmand Philippot2022-08-211-4/+4
| | | | | | | | | Previously, only the first 10 comments was loaded. So I update the fetching method to retrieve all the comments on a post. Also, I choose to order comments on client side because of a bug with WPGraphQL. Finally, I renamed the Comment type to SingleComment to avoid conflict with existing types.
* refactor(types): move and rename GraphQL typesArmand Philippot2022-08-202-2/+2
| | | | | | | The api file in services was not really readable. So I move the types and I also rewrite a little the fetch function. I also rename most of the type to avoid conflict with preexisting types (like Node) and to keep consistency.
* fix(article): prevent TypeError on buildArmand Philippot2022-07-231-3/+6
| | | | | | By switching to custom hooks for revalidating articles and comments, everything was working on development mode but articles failed to build for production.
* refactor(article): wrap useSWR with a custom hook to revalidate articleArmand Philippot2022-07-221-5/+3
|
* fix(comments): refresh comments on changes or new commentArmand Philippot2022-07-221-3/+2
|
* chore: use image title as figure label if no caption is providedArmand Philippot2022-06-071-9/+1
|
* chore: add aria hidden attribute to SVG iconsArmand Philippot2022-06-071-2/+5
|
* chore: handle article fallback and revalidationArmand Philippot2022-05-241-25/+26
| | | | | | By using useSWR I can fetch the changes from the backend. By using fallback, I can access new articles without rebuilding the entire app.
* chore: add a search form on 404 pageArmand Philippot2022-05-241-0/+9
|
* chore: add a search form when posts list prints no resultsArmand Philippot2022-05-245-4/+9
|
* fix: ensure all topics/thematics have the base urlArmand Philippot2022-05-237-30/+27
|
* refactor(schema): use helpers function to avoid repeat between pagesArmand Philippot2022-05-2312-449/+244
|
* refactor: reduce the number of data transformationArmand Philippot2022-05-238-295/+39
|
* chore: update some stylesArmand Philippot2022-05-213-7/+9
| | | | | | | * Improve wp-blocks-columns, wp-block-quote and some images * Make Sharing widget consistent between pages * Remove margin option from lists * Fix Topic logo alignement
* chore: handle blog pagination when JS is disabledArmand Philippot2022-05-205-0/+315
|
* refactor: rewrite Prism hooks and providersArmand Philippot2022-05-191-14/+40
| | | | | It avoid some hydratation errors on project pages (not in article however) and the hooks are now reusable.
* chore: add total articles on thematic pagesArmand Philippot2022-05-181-0/+1
|
* fix: convert undefined into null inside GetStaticPropsArmand Philippot2022-05-171-3/+4
| | | | Next.js was complaining because it cannot serialize undefined values.
* chore: use persistent layoutArmand Philippot2022-05-1713-39/+127
| | | | | It prevents to rerender the common components between pages (header, footer...).
* chore: adjust articles stylesArmand Philippot2022-05-171-2/+16
| | | | | * change animation on article card hover * change comments section alignment