diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-05-24 19:00:40 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-05-24 19:00:40 +0200 |
| commit | d916fba0a54ca2ee89f1de1a4dcc0ee71a3a24c5 (patch) | |
| tree | 4ee4c73f4e9bbe06e7fbe375b10be7e5cc9cdb6c /src/components | |
| parent | 06b46debea14c198ee5de7f7342122a12062eb57 (diff) | |
chore: close search form when launching search
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/organisms/toolbar/toolbar.tsx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/components/organisms/toolbar/toolbar.tsx b/src/components/organisms/toolbar/toolbar.tsx index e196c09..ee61a7b 100644 --- a/src/components/organisms/toolbar/toolbar.tsx +++ b/src/components/organisms/toolbar/toolbar.tsx @@ -1,4 +1,5 @@ import useClickOutside from '@utils/hooks/use-click-outside'; +import useRouteChange from '@utils/hooks/use-route-change'; import { FC, useRef, useState } from 'react'; import MainNav, { type MainNavProps } from '../toolbar/main-nav'; import Search, { type SearchProps } from '../toolbar/search'; @@ -42,6 +43,7 @@ const Toolbar: FC<ToolbarProps> = ({ settingsRef, () => isSettingsOpened && setIsSettingsOpened(false) ); + useRouteChange(() => setIsSearchOpened(false)); return ( <div className={`${styles.wrapper} ${className}`}> |
