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(multidropzone): [SIDE-7] Update MultiDropzone component to have default accept type #315

Conversation

diogomateus
Copy link
Collaborator

What this PR does

Updates MultiDropzone component to:

  • have default accept type
  • have available video group types
  • minor style fixes and message copy updates.

Solves:
SIDE-7

How to test?

Please include additional context on how to test this PR.

Checklist:

  • I reviewed my own code
  • The changes align with the designs I received
    Or give a reason why this does not apply:
  • I have attached screenshot(s), video(s) or gif(s) showing that the solution is working as expected
    Or give a reason why this does not apply:
  • I have updated the task(s) status on Linear
  • All new media is optimized (images, gifs, videos)

Browser support

My code works in the following browsers:

  • Firefox
  • Chrome
  • Safari
  • Edge

@diogomateus diogomateus force-pushed the diogo/side-7-block-customers-from-uploading-unacceptable-file-types branch from a803530 to d8ba9d2 Compare May 17, 2024 12:38
@@ -1,25 +1,41 @@
import { Accept } from "react-dropzone";

export enum FileMimeTypes {
avi = "video/x-msvideo",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👴

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, I know 😄

@@ -128,14 +128,14 @@ describe('MultiDropzone component', () => {
const screen = setup({ accept: 'image' });

expect(
screen.getByText('Supports HEIC, BMP, JPEG, JPG, PNG')
screen.getByText('Supports images, videos and documents')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this show only "images" because we are explicitly adding the { accept: 'image' } object?

It seems like we are dropping the labelling based on the file types. Is that what we want?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@talo242 Fixed it. For custom accept types you need to provide your own label but for generic image/video/documents it will now show the default label.

@diogomateus diogomateus requested a review from talo242 May 21, 2024 09:07
@diogomateus diogomateus force-pushed the diogo/side-7-block-customers-from-uploading-unacceptable-file-types branch from 815222e to bc97671 Compare May 21, 2024 09:08
@diogomateus diogomateus merged commit 17a49f8 into main May 21, 2024
4 checks passed
@diogomateus diogomateus deleted the diogo/side-7-block-customers-from-uploading-unacceptable-file-types branch May 21, 2024 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants