diff --git a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/FreehandCropRegion.tsx b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/FreehandCropRegion.tsx index 32716a2ded..e69de29bb2 100644 --- a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/FreehandCropRegion.tsx +++ b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/FreehandCropRegion.tsx @@ -1,119 +0,0 @@ -import type { Dispatch, Ref, SetStateAction } from "react"; -import { forwardRef } from "react"; -import { CropBoxProps } from "./"; - -interface FreehandCropRegionProps { - cropBox: CropBoxProps; - setIsDragging: Dispatch>; -} - -const FreehandCropRegion = forwardRef( - (props: FreehandCropRegionProps, ref: Ref) => { - return ( - <> - {/* Top overlay */} -
- - {/* Bottom overlay */} -
- - {/* Left overlay */} -
- - {/* Right overlay */} -
- -
- {Array.from({ length: 9 }).map((_, index) => ( -
- ))} - -
{ - e.preventDefault(); - props.setIsDragging(true); - }} - >
-
- - ); - }, -); - -export default FreehandCropRegion; diff --git a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx index 123c2db1cc..c80c7bf8c9 100644 --- a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx @@ -35,13 +35,19 @@ import { Typography, } from "@mui/material"; import { t } from "i18next"; -import type { Dispatch, MutableRefObject, SetStateAction } from "react"; -import { createContext, useContext, useEffect, useRef, useState } from "react"; +import type { Dispatch, MutableRefObject, Ref, SetStateAction } from "react"; +import { + createContext, + forwardRef, + useContext, + useEffect, + useRef, + useState, +} from "react"; import { getLocalCollections } from "services/collectionService"; import uploadManager from "services/upload/uploadManager"; import ColoursMenu from "./ColoursMenu"; import CropMenu, { cropRegionOfCanvas, getCropRegionArgs } from "./CropMenu"; -import FreehandCropRegion from "./FreehandCropRegion"; import TransformMenu from "./TransformMenu"; interface IProps { @@ -724,6 +730,120 @@ const ImageEditorOverlay = (props: IProps) => { export default ImageEditorOverlay; +interface FreehandCropRegionProps { + cropBox: CropBoxProps; + setIsDragging: Dispatch>; +} + +const FreehandCropRegion = forwardRef( + (props: FreehandCropRegionProps, ref: Ref) => { + return ( + <> + {/* Top overlay */} +
+ + {/* Bottom overlay */} +
+ + {/* Left overlay */} +
+ + {/* Right overlay */} +
+ +
+ {Array.from({ length: 9 }).map((_, index) => ( +
+ ))} + +
{ + e.preventDefault(); + props.setIsDragging(true); + }} + >
+
+ + ); + }, +); + const confirmEditorCloseDialogAttributes = ( onConfirm: () => void, ): MiniDialogAttributes => ({