aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/hooks/use-autofocus/index.ts
Commit message (Collapse)AuthorAgeFilesLines
* refactor(components): replace items prop in Navbar componentArmand Philippot2023-11-211-1/+0
| | | | | | | | | | | | | | * replace `items` prop with `children` prop: it is more readable this way, * handle navbar item state inside NavbarItem component: it avoid using three differents states and their methods to do exactly the same thing * remove useAutofocus hook since we can't use it anymore * add `onActivation` and `activationHandlerDelay` prop to NavbarItem component to be able to focus the search input only when the item is activated (it replicates the functioning of useAutofocus hook) * replace `ref` type in SearchForm component: it does not make sense to use an input ref for a form. Instead I use useImperativeHandle to provide different a focus method to the given ref.
* refactor(hooks): replace useInputAutofocus with useAutofocus hookArmand Philippot2023-11-111-0/+1
* extract setTimeout logic using useTimeout * change condition to be a function * return a ref