mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
refactor: extract common components into UI package
This commit is contained in:
10
packages/lib/client-only/get-bounding-client-rect.ts
Normal file
10
packages/lib/client-only/get-bounding-client-rect.ts
Normal file
@ -0,0 +1,10 @@
|
||||
export const getBoundingClientRect = (element: HTMLElement) => {
|
||||
const rect = element.getBoundingClientRect();
|
||||
|
||||
const { width, height } = rect;
|
||||
|
||||
const top = rect.top + window.scrollY;
|
||||
const left = rect.left + window.scrollX;
|
||||
|
||||
return { top, left, width, height };
|
||||
};
|
||||
Reference in New Issue
Block a user