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

Allow users to specify maximum upload size #221

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

azaxarov
Copy link
Collaborator

Addresses #203

Prior to this PR, the media plugin had no customisation options. In particular, there was no way to specify maximum upload size, even though the underlying dropzone component has support for it. This PR is focused around customising the dropzone with maxSize and onDropRejected properties. This PR also introduces MediaToolOptions as a customer-facing API for customising the plugin.

Tool options are stored in ToolOptionsContext, which is exposed to the whole application through useToolOptions hook.

If any of the uploaded files is rejected with file-too-large error code, an error toast will be shown to the customer.

Copy link
Contributor

@snorrees snorrees left a comment

Choose a reason for hiding this comment

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

Good stuff!
Consider the memo comment and merge as you please.
Let me know if the readme is unclear on how you can release a new version via the github action.

src/contexts/ToolOptionsContext.tsx Outdated Show resolved Hide resolved
@azaxarov azaxarov force-pushed the feat/az/maximum-upload-size branch from 68b227e to e97367f Compare July 15, 2024 10:46
@snorrees snorrees self-requested a review July 15, 2024 12:14
@azaxarov azaxarov merged commit ae2bcd8 into main Jul 16, 2024
12 checks passed
@azaxarov azaxarov deleted the feat/az/maximum-upload-size branch July 16, 2024 07:08
Copy link

🎉 This PR is included in version 2.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants