File upload file type exclusions and language variations

This commit is contained in:
2022-10-04 11:18:59 +01:00
parent 6bfdd76f1c
commit cd97bc6a19
3 changed files with 20 additions and 7 deletions
+14 -5
View File
@@ -1290,6 +1290,7 @@ const rejectStyle = {
const RenderFileUpload = (field) => {
const files = field.input.value;
let { t } = useTranslation();
const style = useMemo(
() => ({
...baseStyle,
@@ -1478,10 +1479,7 @@ const RenderFileUpload = (field) => {
return (
<>
<Dropzone
// onDrop={(filesToUpload, e) =>
// field.input.onChange(filesToUpload)
// }
accept="application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/tiff,image/jpeg,application/zip"
onDrop={(filesToUpload, e) => {
const renamedAcceptedFiles = filesToUpload.map(
(file) =>
@@ -1508,7 +1506,18 @@ const RenderFileUpload = (field) => {
<div {...getRootProps({ style })}>
{" "}
<input id={field.id} {...getInputProps()} />
<div>Drag and drop your files here.</div>
<div>
{t(
"newappeal:new-appeal-fileupload-drop-label"
)}
</div>
<em>
(
{t(
"newappeal:new-appeal-fileupload-file-list-label"
)}
)
</em>
</div>
<aside>{thumbs}</aside>
</section>