Skip to content

armgit / ente

Public Imported from GitHub
0

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

Use

Manav Rathi79f5d6763c9c
diff --git a/web/packages/base/components/mui/SidebarDrawer.tsx b/web/packages/base/components/mui/SidebarDrawer.tsx
index c3ac89d176..8760920d86 100644
--- a/web/packages/base/components/mui/SidebarDrawer.tsx
+++ b/web/packages/base/components/mui/SidebarDrawer.tsx
@@ -180,6 +180,30 @@ export const SidebarDrawerTitlebar: React.FC<SidebarDrawerTitlebarProps> = ({
</Stack>
);
+/**
+ * A variant of {@link SidebarDrawerTitlebar} with a close button where the back
+ * button is, and none of the other whistles.
+ *
+ * This is currently only used by the top level "File info" screen; the reason
+ * for keeping this here so that it also gets modified when we modify the
+ * spacing etc for {@link SidebarDrawerTitlebar} so that they both look visually
+ * similar (apart from the obvious icon differences).
+ */
+export const SidebarDrawerTitlebarClose: React.FC<
+ Pick<SidebarDrawerTitlebarProps, "onClose" | "title">
+> = ({ title, onClose }) => (
+ <Stack sx={{ gap: "4px" }}>
+ <Stack direction="row" sx={{ justifyContent: "space-between" }}>
+ <IconButton onClick={onClose} color="secondary">
+ <CloseIcon />
+ </IconButton>
+ </Stack>
+ <Box sx={{ px: "16px", py: "4px" }}>
+ <Typography variant="h3">{title}</Typography>
+ </Box>
+ </Stack>
+);
+
/**
* A variant of {@link NestedSidebarDrawer} that additionally shows a title.
*
diff --git a/web/packages/gallery/components/FileInfo.tsx b/web/packages/gallery/components/FileInfo.tsx
index 379633112c..5f32c37bdb 100644
--- a/web/packages/gallery/components/FileInfo.tsx
+++ b/web/packages/gallery/components/FileInfo.tsx
@@ -38,9 +38,12 @@ import { isDesktop } from "ente-base/app";
import { LinkButtonUndecorated } from "ente-base/components/LinkButton";
import { type ButtonishProps } from "ente-base/components/mui";
import { ActivityIndicator } from "ente-base/components/mui/ActivityIndicator";
-import { SidebarDrawer } from "ente-base/components/mui/SidebarDrawer";
+import {
+ SidebarDrawer,
+ SidebarDrawerTitlebar,
+ SidebarDrawerTitlebarClose,
+} from "ente-base/components/mui/SidebarDrawer";
import { SingleInputForm } from "ente-base/components/SingleInputForm";
-import { Titlebar } from "ente-base/components/Titlebar";
import { EllipsizedTypography } from "ente-base/components/Typography";
import {
useModalVisibility,
@@ -264,7 +267,7 @@ export const FileInfo: React.FC<FileInfoProps> = ({
return (
<FileInfoSidebar {...{ open, onClose }}>
- <Titlebar onClose={onClose} title={t("info")} backIsClose />
+ <SidebarDrawerTitlebarClose {...{ onClose }} title={t("info")} />
<Stack sx={{ pt: 1, pb: 3, gap: "20px" }}>
<Caption
{...{
@@ -985,11 +988,11 @@ const RawExif: React.FC<RawExifProps> = ({
return (
<FileInfoSidebar open={open} onClose={onClose}>
- <Titlebar
+ <SidebarDrawerTitlebar
onClose={onClose}
+ onRootClose={handleRootClose}
title={t("exif")}
caption={fileName}
- onRootClose={handleRootClose}
actionButton={
<CopyButton size="small" text={JSON.stringify(tags)} />
}