refactor: extract common components into UI package

This commit is contained in:
David Nguyen
2023-08-23 11:22:13 +10:00
committed by Mythie
parent 98862a6356
commit a0abf56833
50 changed files with 113493 additions and 926 deletions

View 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 };
};