diff --git a/apps/client/src/widgets/react/ActionButton.tsx b/apps/client/src/widgets/react/ActionButton.tsx index 5adacc5c1..65eb60469 100644 --- a/apps/client/src/widgets/react/ActionButton.tsx +++ b/apps/client/src/widgets/react/ActionButton.tsx @@ -1,13 +1,14 @@ interface ActionButtonProps { text: string; icon: string; + className?: string; onClick?: () => void; } -export default function ActionButton({ text, icon, onClick }: ActionButtonProps) { +export default function ActionButton({ text, icon, className, onClick }: ActionButtonProps) { return - - - -`; - export default class NoteMapRibbonWidget extends NoteContextAwareWidget { private openState!: "small" | "full"; @@ -50,37 +42,7 @@ export default class NoteMapRibbonWidget extends NoteContextAwareWidget { this.noteMapWidget.setDimensions(); }); - const handleResize = () => { - if (!this.noteMapWidget.graph) { - // no graph has been even rendered - return; - } - - if (this.openState === "full") { - this.setFullHeight(); - } else if (this.openState === "small") { - this.setSmallSize(); - } - }; - new ResizeObserver(handleResize).observe(this.$widget[0]); } - setSmallSize() { - const SMALL_SIZE_HEIGHT = 300; - const width = this.$widget.width() ?? 0; - - this.$widget.find(".note-map-container").height(SMALL_SIZE_HEIGHT).width(width); - } - - setFullHeight() { - const { top } = this.$widget[0].getBoundingClientRect(); - - const height = ($(window).height() ?? 0) - top; - const width = this.$widget.width() ?? 0; - - this.$widget.find(".note-map-container") - .height(height) - .width(width); - } }