aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/providers
Commit message (Collapse)AuthorAgeFilesLines
* refactor(providers,hooks): rewrite PrismThemeProvider & usePrismThemeArmand Philippot2023-11-116-169/+145
| | | | | | * 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-114-0/+168
| | | | | | | 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-114-0/+135
| | | | | | | | | | 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-115-59/+143
|
* refactor(hooks): rewrite useLocalStorage hookArmand Philippot2023-11-111-26/+35
| | | | | | | * 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: use named export for everything except pagesArmand Philippot2023-09-202-3/+3
| | | | | | 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-3/+3
| | | | | | 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.
* refactor: rewrite Prism hooks and providersArmand Philippot2022-05-191-47/+31
| | | | | It avoid some hydratation errors on project pages (not in article however) and the hooks are now reusable.
* chore: handle settings changeArmand Philippot2022-05-181-1/+1
|
* chore: remove old pages, components, helpers and typesArmand Philippot2022-04-292-1/+4
| | | | | Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch.
* refactor: load prism plugins without babelArmand Philippot2022-03-241-2/+6
|
* feat: improve Ackee tracking (#11)Armand Philippot2022-02-231-0/+57
| | | | | | | | | | | | | | | | | * build(deps): add use-ackee hook package * chore: create a context provider for Ackee The provider allows users to change the 'detailed' settings. * chore: add a select menu to choose which info to share with Ackee * chore: add a tooltip for askee settings * chore: replace default select styles with custom styles * chore: register user choice in localstorage * chore: replace Matomo with Ackee in legal notice
* refactor(prism): rename color scheme attributes and remove prefixArmand Philippot2022-02-081-2/+1
|
* chore: add a new settings to handle prism theme from toolbarArmand Philippot2022-02-011-0/+162