Skip to content

armgit / ente

Public Imported from GitHub
0

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

update(EditAlbumDetailsDialog):update-styles-responsiveness

Aswin Asok5b3c4375a802
diff --git a/web/apps/photos/src/components/Collections/EditAlbumDetailsDialog.tsx b/web/apps/photos/src/components/Collections/EditAlbumDetailsDialog.tsx
index 584966e00e..f9527267f9 100644
--- a/web/apps/photos/src/components/Collections/EditAlbumDetailsDialog.tsx
+++ b/web/apps/photos/src/components/Collections/EditAlbumDetailsDialog.tsx
@@ -19,6 +19,11 @@ import {
type ModalVisibilityProps,
} from "ente-base/components/utils/modal";
import { useBaseContext } from "ente-base/context";
+import {
+ uploadSheetMediaQuery,
+ uploadSheetPaperSx,
+ useIsUploadSheet,
+} from "ente-gallery/components/upload-progress/bottom-sheet";
import {
maxAlbumDescriptionLength,
type Collection,
@@ -27,6 +32,7 @@ import type { EnteFile } from "ente-media/file";
import { FileType } from "ente-media/file-type";
import { ItemCard } from "ente-new/photos/components/Tiles";
import { FocusVisibleUnstyledButton } from "ente-new/photos/components/UnstyledButton";
+import { SlideUpTransition } from "ente-new/photos/components/mui/SlideUpTransition";
import { albumDescriptionGraphemeCount } from "ente-new/photos/services/collection";
import { useFormik } from "formik";
import { t } from "i18next";
@@ -58,6 +64,7 @@ export const EditAlbumDetailsDialog: React.FC<EditAlbumDetailsDialogProps> = ({
onSubmit,
}) => {
const { showMiniDialog, onGenericError } = useBaseContext();
+ const isSheet = useIsUploadSheet();
const titleID = useId();
const nameID = useId();
const descriptionID = useId();
@@ -150,12 +157,13 @@ export const EditAlbumDetailsDialog: React.FC<EditAlbumDetailsDialogProps> = ({
}
aria-labelledby={titleID}
maxWidth={false}
- slotProps={{ paper: { sx: paperSx } }}
+ slots={isSheet ? { transition: SlideUpTransition } : undefined}
+ slotProps={{ paper: { sx: [paperSx, uploadSheetPaperSx] } }}
>
<Stack
component="form"
onSubmit={formik.handleSubmit}
- sx={{ p: "20px", gap: "36px" }}
+ sx={contentSx}
>
<Stack direction="row" sx={headerSx}>
<Typography id={titleID} sx={titleSx}>
@@ -320,7 +328,7 @@ const green = "#08c225";
const greenHover = "#07ad21";
const errorColor = "#fa1336";
-const paperSx: SxProps<Theme> = (theme) => ({
+const paperSx = (theme: Theme) => ({
width: "min(520px, calc(100svw - 32px))",
maxWidth: "520px",
m: 2,
@@ -336,6 +344,16 @@ const paperSx: SxProps<Theme> = (theme) => ({
}),
});
+const contentSx = {
+ p: "20px",
+ gap: "36px",
+ [uploadSheetMediaQuery]: {
+ p: "12px 16px",
+ pb: "calc(20px + env(safe-area-inset-bottom, 0px))",
+ overflowY: "auto",
+ },
+};
+
const headerSx = {
alignItems: "center",
justifyContent: "space-between",