Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor isDropImageFrom file to utils file and add unit testing #231

Open
brauliodiez opened this issue Aug 19, 2024 · 0 comments · May be fixed by #400
Open

Refactor isDropImageFrom file to utils file and add unit testing #231

brauliodiez opened this issue Aug 19, 2024 · 0 comments · May be fixed by #400
Assignees

Comments

@brauliodiez
Copy link
Member

Under this path

src/pods/canvas/use-drop-image-from-desktop.tsx

Inside the hook, we've got this function

  const isDropImageFile = (e: React.DragEvent<HTMLDivElement>) => {
    return (
      e.dataTransfer.items.length > 0 &&
      e.dataTransfer.items[0].kind === 'file' &&
      e.dataTransfer.items[0].type.startsWith('image/')
    );
  };

We should move it to canvas.util or similar (or drop-image.utils.ts) and add unit test support for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
2 participants