Preview local file before send
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { Box } from "@mui/material";
|
import { Box, Link } from "@mui/material";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import fileDocument from "../img/file-document.svg";
|
import fileDocument from "../img/file-document.svg";
|
||||||
import fileImage from "../img/file-image.svg";
|
import fileImage from "../img/file-image.svg";
|
||||||
@@ -32,16 +32,18 @@ const AttachmentIcon = (props) => {
|
|||||||
imageLabel = t("notifications_attachment_file_document");
|
imageLabel = t("notifications_attachment_file_document");
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Box
|
<Link href={props.href} target="_blank">
|
||||||
component="img"
|
<Box
|
||||||
src={imageFile}
|
component="img"
|
||||||
alt={imageLabel}
|
src={imageFile}
|
||||||
loading="lazy"
|
alt={imageLabel}
|
||||||
sx={{
|
loading="lazy"
|
||||||
width: "28px",
|
sx={{
|
||||||
height: "28px",
|
width: "28px",
|
||||||
}}
|
height: "28px",
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -798,7 +798,7 @@ const AttachmentBox = (props) => {
|
|||||||
borderRadius: "4px",
|
borderRadius: "4px",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<AttachmentIcon type={file.type} />
|
<AttachmentIcon type={file.type} href={URL.createObjectURL(file)} />
|
||||||
<Box sx={{ marginLeft: 1, textAlign: "left" }}>
|
<Box sx={{ marginLeft: 1, textAlign: "left" }}>
|
||||||
<ExpandingTextField
|
<ExpandingTextField
|
||||||
minWidth={140}
|
minWidth={140}
|
||||||
|
|||||||
Reference in New Issue
Block a user