| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
| |
* extract setTimeout logic using useTimeout
* change condition to be a function
* return a ref
|
| | |
|
| |
|
|
|
|
|
| |
* remove `useCapture` parameter (it does not make sense to use bubbling
here)
* return a MutableRefObject instead of a RefObject to be able to test
the hook
|
| |
|
|
|
|
|
|
| |
* 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)
|
| | |
|
| |
|
|
|
|
| |
* reuse Theme provider logic
* move DOM mutation from provider to hook
* add a script to init theme before page load
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
| |
* 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
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
By switching to custom hooks for revalidating articles and comments,
everything was working on development mode but articles failed to build
for production.
|
| | |
|
| | |
|
| |
|
|
|
| |
The event was not captured so the tooltip remained open when the
settings was closed. It prevented to click on the toolbar buttons.
|
| | |
|
| |
|
|
|
|
|
| |
I moved the website picture from useSettings to the layout
component since it is only used here. This reduce the number
of Jest errors. However, there's still some issues with some
images import...
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
The tooltip was closing and reopening on click because of a conflict
between the button event and the hook useClickOutside. By checking that
the event target is not the button, the tooltip is now closing as
expected.
|
| | |
|
| |
|
|
|
| |
It avoid some hydratation errors on project pages (not in article
however) and the hooks are now reusable.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
* add logo to topics pages and links
* add Prism styles to articles
* and a few other adjustements
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Since I'm using new components, I will also rewrite the GraphQL queries
so it is easier to start from scratch.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Instead of using post slug and an environment variable to fetch repo
data, I use the given repo in each project MDX file. It allows me to
fetch data from another user/organization if needed.
To make it work, I no longer provide the full URL in MDX file. The new
format is: "User/repo-slug".
I also replaced the fetch method with SWR to improve caching and to
avoid React complaining about cleanup useEffect.
|
| |
|
|
|
|
| |
On subject pages for example, the table of contents was not updated on
route change. So I added router.asPath as dependency of useEffect.
I also changed the query to exclude all titles in aside (ToC, widgets).
|