Skip to content

Commit

Permalink
OV-198: * getElementEnd helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanchousina committed Sep 11, 2024
1 parent a2d17c7 commit 9768fe9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ const ScenesRow: React.FC = () => {

const buttonEnd = getElementEnd(
scenesEnd,
buttonWidthInPixels,
pixelsToValue,
pixelsToValue(buttonWidthInPixels),
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ const ScriptsRow: React.FC = () => {

const buttonEnd = getElementEnd(
scriptsEnd,
buttonWidthInPixels,
pixelsToValue,
pixelsToValue(buttonWidthInPixels),
);

return (
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/bundles/studio/helpers/get-element-end.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { type PixelsToValue } from 'dnd-timeline';

const getElementEnd = (
itemsEnd: number,
widthInPixels: number,
pixelsToValue: PixelsToValue,
): number => {
const elementWidth = pixelsToValue(widthInPixels);
const getElementEnd = (itemsEnd: number, elementWidth: number): number => {
return itemsEnd + (Number.isFinite(elementWidth) ? elementWidth : 0);
};

Expand Down

0 comments on commit 9768fe9

Please sign in to comment.