mirror of
https://github.com/ente-io/ente.git
synced 2025-08-13 01:27:17 +00:00
Tweak
This commit is contained in:
@@ -43,7 +43,13 @@ import EditIcon from "@mui/icons-material/Edit";
|
||||
import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";
|
||||
import { Button, Menu, MenuItem, styled, Typography } from "@mui/material";
|
||||
import { t } from "i18next";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import React, {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { fileInfoExifForFile, updateItemDataAlt } from "./data-source";
|
||||
import {
|
||||
FileViewerPhotoSwipe,
|
||||
@@ -606,33 +612,34 @@ const FileViewer: React.FC<FileViewerProps> = ({
|
||||
>
|
||||
{activeAnnotatedFile?.annotation.showDownload == "menu" && (
|
||||
<MoreMenuItem onClick={handleDownloadMenuAction}>
|
||||
<Typography sx={{ fontWeight: "medium" }}>
|
||||
<MoreMenuItemTitle>
|
||||
{/*TODO */ t("download")}
|
||||
</Typography>
|
||||
</MoreMenuItemTitle>
|
||||
<FileDownloadOutlinedIcon />
|
||||
</MoreMenuItem>
|
||||
)}
|
||||
{activeAnnotatedFile?.annotation.showDelete && (
|
||||
<MoreMenuItem onClick={handleConfirmDelete}>
|
||||
<Typography sx={{ fontWeight: "medium" }}>
|
||||
<MoreMenuItemTitle>
|
||||
{/*TODO */ t("delete")}
|
||||
</Typography>
|
||||
</MoreMenuItemTitle>
|
||||
<DeleteIcon />
|
||||
</MoreMenuItem>
|
||||
)}
|
||||
{activeAnnotatedFile?.annotation.showCopyImage && (
|
||||
<MoreMenuItem onClick={handleCopyImage}>
|
||||
<Typography sx={{ fontWeight: "medium" }}>
|
||||
<MoreMenuItemTitle>
|
||||
{/*TODO */ pt("Copy image")}
|
||||
</Typography>
|
||||
<ContentCopyIcon />
|
||||
</MoreMenuItemTitle>
|
||||
{/* Tweak icon size to visually fit better with neighbours */}
|
||||
<ContentCopyIcon sx={{ "&&": { fontSize: "18px" } }} />
|
||||
</MoreMenuItem>
|
||||
)}
|
||||
{activeAnnotatedFile?.annotation.showEditImage && (
|
||||
<MoreMenuItem onClick={handleEditImage}>
|
||||
<Typography sx={{ fontWeight: "medium" }}>
|
||||
<MoreMenuItemTitle>
|
||||
{/*TODO */ pt("Edit image")}
|
||||
</Typography>
|
||||
</MoreMenuItemTitle>
|
||||
<EditIcon />
|
||||
</MoreMenuItem>
|
||||
)}
|
||||
@@ -698,6 +705,10 @@ const MoreMenuItem = styled(MenuItem)`
|
||||
}
|
||||
`;
|
||||
|
||||
const MoreMenuItemTitle: React.FC<React.PropsWithChildren> = ({ children }) => (
|
||||
<Typography sx={{ fontWeight: "medium" }}>{children}</Typography>
|
||||
);
|
||||
|
||||
const fileIsEditableImage = (file: EnteFile) => {
|
||||
// Only images are editable.
|
||||
if (file.metadata.fileType !== FileType.image) return false;
|
||||
|
Reference in New Issue
Block a user