aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/templates
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-15 17:09:13 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-15 17:26:17 +0100
commit36baf3e5725aeae00d81d3a082b3c04074e09f8e (patch)
tree34069dc40f7cd45707e8cea0a8993e94841af778 /src/components/templates
parentc826ad66df066b90b09009f2f4b83b56d018436e (diff)
refactor(hooks): replace useRouteChange with useOnRouteChange hook
* handle both event start and event complete * clean the effect * add tests
Diffstat (limited to 'src/components/templates')
-rw-r--r--src/components/templates/layout/layout.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/templates/layout/layout.tsx b/src/components/templates/layout/layout.tsx
index 5dad8a2..055b1a1 100644
--- a/src/components/templates/layout/layout.tsx
+++ b/src/components/templates/layout/layout.tsx
@@ -19,7 +19,7 @@ import { ROUTES } from '../../../utils/constants';
import {
useAutofocus,
useBoolean,
- useRouteChange,
+ useOnRouteChange,
useScrollPosition,
} from '../../../utils/hooks';
import {
@@ -271,7 +271,7 @@ export const Layout: FC<LayoutProps> = ({
[intl, router]
);
- useRouteChange(deactivateSearch);
+ useOnRouteChange(deactivateSearch);
const navbarItems: NavbarItems = [
{
@@ -382,7 +382,7 @@ export const Layout: FC<LayoutProps> = ({
if (topRef.current) topRef.current.focus();
};
- useRouteChange(giveFocusToTopRef);
+ useOnRouteChange(giveFocusToTopRef);
const brandingTitleStyles = {
'--typing-animation':