mirror of
https://github.com/binwiederhier/ntfy.git
synced 2024-12-23 18:23:27 +01:00
Preview local file before send
This commit is contained in:
parent
a3312f69fb
commit
94781c89f3
2 changed files with 14 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
import * as React from "react";
|
||||
import { Box } from "@mui/material";
|
||||
import { Box, Link } from "@mui/material";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import fileDocument from "../img/file-document.svg";
|
||||
import fileImage from "../img/file-image.svg";
|
||||
|
@ -32,16 +32,18 @@ const AttachmentIcon = (props) => {
|
|||
imageLabel = t("notifications_attachment_file_document");
|
||||
}
|
||||
return (
|
||||
<Box
|
||||
component="img"
|
||||
src={imageFile}
|
||||
alt={imageLabel}
|
||||
loading="lazy"
|
||||
sx={{
|
||||
width: "28px",
|
||||
height: "28px",
|
||||
}}
|
||||
/>
|
||||
<Link href={props.href} target="_blank">
|
||||
<Box
|
||||
component="img"
|
||||
src={imageFile}
|
||||
alt={imageLabel}
|
||||
loading="lazy"
|
||||
sx={{
|
||||
width: "28px",
|
||||
height: "28px",
|
||||
}}
|
||||
/>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -798,7 +798,7 @@ const AttachmentBox = (props) => {
|
|||
borderRadius: "4px",
|
||||
}}
|
||||
>
|
||||
<AttachmentIcon type={file.type} />
|
||||
<AttachmentIcon type={file.type} href={URL.createObjectURL(file)} />
|
||||
<Box sx={{ marginLeft: 1, textAlign: "left" }}>
|
||||
<ExpandingTextField
|
||||
minWidth={140}
|
||||
|
|
Loading…
Reference in a new issue