Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Revert "revert(FileInfo):hint-change"

Aswin Asok362b9b56ec85
diff --git a/web/packages/base/locales/en-US/translation.json b/web/packages/base/locales/en-US/translation.json
index 0e267cf7cd..49c63eff0d 100644
--- a/web/packages/base/locales/en-US/translation.json
+++ b/web/packages/base/locales/en-US/translation.json
@@ -362,7 +362,10 @@
"details": "Details",
"view_exif": "View all Exif data",
"no_exif": "No Exif data",
- "file_info_arrow_navigation_hint": "Press Alt / Option + the left or right arrow to move between files",
+ "file_info_arrow_navigation_hint_use": "Use",
+ "file_info_arrow_navigation_hint_left_arrow": "Left arrow",
+ "file_info_arrow_navigation_hint_right_arrow": "Right arrow",
+ "file_info_arrow_navigation_hint": "to navigate",
"exif": "Exif",
"two_factor": "Two-factor",
"two_factor_authentication": "Two-factor authentication",
diff --git a/web/packages/gallery/components/FileInfo.tsx b/web/packages/gallery/components/FileInfo.tsx
index 5c4ee2a5b0..5a111a9fc1 100644
--- a/web/packages/gallery/components/FileInfo.tsx
+++ b/web/packages/gallery/components/FileInfo.tsx
@@ -13,6 +13,9 @@ import DoneIcon from "@mui/icons-material/Done";
import EditIcon from "@mui/icons-material/Edit";
import FaceRetouchingNaturalIcon from "@mui/icons-material/FaceRetouchingNatural";
import FolderOutlinedIcon from "@mui/icons-material/FolderOutlined";
+import KeyboardArrowLeftIcon from "@mui/icons-material/KeyboardArrowLeft";
+import KeyboardArrowRightIcon from "@mui/icons-material/KeyboardArrowRight";
+import KeyboardOptionKeyIcon from "@mui/icons-material/KeyboardOptionKey";
import LocationOnOutlinedIcon from "@mui/icons-material/LocationOnOutlined";
import PhotoOutlinedIcon from "@mui/icons-material/PhotoOutlined";
import TextSnippetOutlinedIcon from "@mui/icons-material/TextSnippetOutlined";
@@ -523,10 +526,12 @@ export const FileInfo: React.FC<FileInfoProps> = ({
};
const FileInfoNavigationHint: React.FC = () => (
- <Typography
- variant="tiny"
+ <Stack
+ direction="row"
sx={{
- display: { xs: "none", sm: "block" },
+ display: { xs: "none", sm: "flex" },
+ alignItems: "center",
+ gap: 0.5,
mt: "auto",
pb: 3,
px: 2,
@@ -534,7 +539,61 @@ const FileInfoNavigationHint: React.FC = () => (
opacity: 0.24,
}}
>
- {t("file_info_arrow_navigation_hint")}
+ <Typography component="span" variant="tiny">
+ {t("file_info_arrow_navigation_hint_use")}
+ </Typography>
+ <NavigationHintKey>
+ <KeyboardOptionKeyIcon sx={{ fontSize: 12 }} />
+ <Typography
+ component="span"
+ variant="tiny"
+ sx={{ fontWeight: "medium" }}
+ >
+ Alt / Option
+ </Typography>
+ </NavigationHintKey>
+ <NavigationHintSeparator>+</NavigationHintSeparator>
+ <NavigationHintKey>
+ <KeyboardArrowLeftIcon
+ titleAccess={t("file_info_arrow_navigation_hint_left_arrow")}
+ sx={{ fontSize: 14 }}
+ />
+ </NavigationHintKey>
+ <NavigationHintSeparator>/</NavigationHintSeparator>
+ <NavigationHintKey>
+ <KeyboardArrowRightIcon
+ titleAccess={t("file_info_arrow_navigation_hint_right_arrow")}
+ sx={{ fontSize: 14 }}
+ />
+ </NavigationHintKey>
+ <Typography component="span" variant="tiny" sx={{ ml: 0.5 }}>
+ {t("file_info_arrow_navigation_hint")}
+ </Typography>
+ </Stack>
+);
+
+const NavigationHintKey = styled("span")(
+ ({ theme }) => `
+ min-height: 20px;
+ display: inline-flex;
+ align-items: center;
+ gap: 3px;
+ padding: 2px 5px;
+ border: 1px solid ${theme.vars.palette.stroke.faint};
+ border-radius: 4px;
+ color: ${theme.vars.palette.text.muted};
+`,
+);
+
+const NavigationHintSeparator: React.FC<React.PropsWithChildren> = ({
+ children,
+}) => (
+ <Typography
+ component="span"
+ variant="tiny"
+ sx={{ color: "text.faint", lineHeight: 1 }}
+ >
+ {children}
</Typography>
);