mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-30 06:02:00 +02:00
Refactor desktop app into separate client and proxy apps
This commit is contained in:
9
apps/yaak-client/hooks/useScrollIntoView.ts
Normal file
9
apps/yaak-client/hooks/useScrollIntoView.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export function useScrollIntoView<T extends HTMLElement>(node: T | null, enabled: boolean) {
|
||||
useEffect(() => {
|
||||
if (enabled) {
|
||||
node?.scrollIntoView({ block: 'nearest' });
|
||||
}
|
||||
}, [enabled, node]);
|
||||
}
|
||||
Reference in New Issue
Block a user