diff --git a/src/ui/components/Interactive.js b/src/ui/components/Interactive.js index 663f6fd25..33260f433 100644 --- a/src/ui/components/Interactive.js +++ b/src/ui/components/Interactive.js @@ -12,7 +12,7 @@ import { maybeSnapLeft, maybeSnapTop, SNAP_SIZE, -} from '../../utils/snap.js'; +} from '../../utils/snap.tsx'; import styled from '../styled/index.js'; import invariant from 'invariant'; import React from 'react'; diff --git a/src/utils/snap.js b/src/utils/snap.tsx similarity index 95% rename from src/utils/snap.js rename to src/utils/snap.tsx index 723caabb1..377d005be 100644 --- a/src/utils/snap.js +++ b/src/utils/snap.tsx @@ -5,7 +5,7 @@ * @format */ -import type {Rect} from './geometry.js'; +import {Rect} from './geometry.js'; export const SNAP_SIZE = 16; @@ -19,10 +19,10 @@ export function getPossibleSnappedPosition( getGap, getNew, }: { - getNew: (win: Rect) => number, - getGap: (win: Rect) => number, + getNew: (win: Rect) => number; + getGap: (win: Rect) => number; }, -): ?number { +): number | undefined { for (const win of windows) { const gap = Math.abs(getGap(win)); if (gap >= 0 && gap < SNAP_SIZE) { @@ -87,7 +87,6 @@ export function maybeSnapLeft( // │A│B│ // └─┴─┘ const snapRight = getPossibleSnappedPosition(windows, { - debug: true, getGap: win => win.left - (props.width + left), getNew: win => win.left - props.width, });