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.
Addresses https://github.com/sanity-io/sanity-plugin-media/issues/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
andonDropRejected
properties. This PR also introducesMediaToolOptions
as a customer-facing API for customising the plugin.Tool options are stored in
ToolOptionsContext
, which is exposed to the whole application throughuseToolOptions
hook.If any of the uploaded files is rejected with
file-too-large
error code, an error toast will be shown to the customer.