Revert "chore(collections/calendar): experiment with avoiding floating buttons"

This reverts commit 6c4ac347db.
This commit is contained in:
Elian Doran
2025-09-06 13:17:21 +03:00
parent 6c4ac347db
commit 05ebe821f2
2 changed files with 2 additions and 21 deletions

View File

@@ -642,21 +642,3 @@ export function useResizeObserver(ref: RefObject<HTMLElement>, callback: () => v
return () => observer.disconnect();
}, [ callback, ref ]);
}
export function useFloatingButtonsWidth() {
const [ width, setWidth ] = useState(0);
const parentComponent = useContext(ParentComponent);
const containerRef = useRef<HTMLElement>(null);
useEffect(() => {
const containerEl = parentComponent?.$widget
.closest(".note-split")
.find(".floating-buttons-children")[0];
containerRef.current = (containerEl as HTMLElement | undefined) ?? null;
});
useResizeObserver(containerRef, () => {
console.log("Got width ", containerRef.current?.getBoundingClientRect().width);
setWidth(containerRef.current?.getBoundingClientRect().width ?? 0);
});
return width;
}