Skip to content

Commit 9cd7196

Browse files
authored
Update ModalDropzone.jsx
1 parent 84ce5fd commit 9cd7196

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/generic/modal-dropzone/ModalDropzone.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { FileUpload as FileUploadIcon } from '@openedx/paragon/icons';
1616
import useModalDropzone from './useModalDropzone';
1717
import messages from './messages';
1818
import { getUploadFileMaxSize } from '@src/constants';
19-
const UPLOAD_FILE_MAX_SIZE = getUploadFileMaxSize();
2019

2120
const ModalDropzone = ({
2221
fileTypes,
@@ -31,7 +30,7 @@ const ModalDropzone = ({
3130
onChange,
3231
onSavingStatus,
3332
onSelectFile,
34-
maxSize = UPLOAD_FILE_MAX_SIZE,
33+
maxSize,
3534
}) => {
3635
const {
3736
intl,
@@ -47,9 +46,10 @@ const ModalDropzone = ({
4746
onChange, onCancel, onClose, fileTypes, onSavingStatus, onSelectFile,
4847
});
4948

49+
5050
const invalidSizeMore = invalidFileSizeMore || intl.formatMessage(
5151
messages.uploadImageDropzoneInvalidSizeMore,
52-
{ maxSize: maxSize / (1024 * 1024) },
52+
{ maxSize: (maxSize || getUploadFileMaxSize()) / (1024 * 1024) },
5353
);
5454

5555
const inputComponent = previewUrl ? (
@@ -130,7 +130,7 @@ ModalDropzone.defaultProps = {
130130
imageHelpText: '',
131131
previewComponent: null,
132132
imageDropzoneText: '',
133-
maxSize: UPLOAD_FILE_MAX_SIZE,
133+
maxSize: '',
134134
invalidFileSizeMore: '',
135135
onSelectFile: null,
136136
};

0 commit comments

Comments
 (0)