Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
istarkov committed Dec 3, 2024
1 parent 50b0116 commit 89237a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import {
import { Label } from "./outline/label";
import { Outline } from "./outline/outline";
import { useSubscribeDragAndDropState } from "./use-subscribe-drag-drop-state";
import { ResizeHandles } from "./resize-handles";
import { MediaBadge } from "./media-badge";
import { applyScale } from "./outline";
import { $scale } from "~/builder/shared/nano-states";
import { BlockChildHoveredInstanceOutline } from "./outline/block-instance-outline";
Expand Down Expand Up @@ -73,8 +71,6 @@ export const CanvasTools = () => {

return (
<>
<MediaBadge />
<ResizeHandles />
{isPreviewMode === false && (
<>
<SelectedInstanceOutline />
Expand Down
12 changes: 11 additions & 1 deletion apps/builder/app/builder/features/workspace/workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { $textEditingInstanceSelector } from "~/shared/nano-states";
import { CanvasTools } from "./canvas-tools";
import { useSetCanvasWidth } from "../breakpoints";
import { selectInstance } from "~/shared/awareness";
import { ResizeHandles } from "./canvas-tools/resize-handles";
import { MediaBadge } from "./canvas-tools/media-badge";

const workspaceStyle = css({
flexGrow: 1,
Expand Down Expand Up @@ -101,6 +103,7 @@ export const Workspace = ({ children, onTransitionEnd }: WorkspaceProps) => {
selectInstance(undefined);
$textEditingInstanceSelector.set(undefined);
};
const outlineStyle = useOutlineStyle();

return (
<>
Expand All @@ -116,14 +119,21 @@ export const Workspace = ({ children, onTransitionEnd }: WorkspaceProps) => {
>
{children}
</div>
<div
data-name="canvas-tools-wrapper"
className={canvasContainerStyle({ css: { pointerEvents: "none" } })}
style={outlineStyle}
>
<MediaBadge />
<ResizeHandles />
</div>
</div>
</>
);
};

export const CanvasToolsContainer = () => {
const outlineStyle = useOutlineStyle();
useSetCanvasWidth();

return (
<>
Expand Down

0 comments on commit 89237a9

Please sign in to comment.