aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/hooks/index.ts
Commit message (Collapse)AuthorAgeFilesLines
* feat(hooks): add an useForm hookArmand Philippot2023-11-111-0/+1
| | | | | | | | | * 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(hooks): replace useInputAutofocus with useAutofocus hookArmand Philippot2023-11-111-1/+1
| | | | | | * extract setTimeout logic using useTimeout * change condition to be a function * return a ref
* feat(hooks): add an useTimeout hookArmand Philippot2023-11-111-0/+1
|
* feat(components): add an Overlay componentArmand Philippot2023-11-111-0/+2
| | | | | | | | * add useScrollbarWidth hook * add useScrollLock hook * add a new component to lock scroll with an overlay (it can be useful especially on small screens to prevent background contents to be scrolled)
* feat(hooks): add useBoolean and useToggle hooksArmand Philippot2023-11-111-0/+2
|
* refactor(providers,hooks): rewrite PrismThemeProvider & usePrismThemeArmand Philippot2023-11-111-3/+1
| | | | | | * 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-111-0/+3
| | | | | | | 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-111-0/+1
| | | | | | | | | | 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-1/+1
|
* refactor(components): rewrite Branding componentArmand Philippot2023-11-111-1/+0
| | | | | | The component should only be responsible of the layout for the logo, the name and the optional baseline. Also, the homepage url could be different from `/` so the consumer should give the right url.
* refactor: use named export for everything except pagesArmand Philippot2023-09-201-0/+24
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.