π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Inline
Manav Rathib7c81656a3b6
diff --git a/web/apps/photos/src/components/Upload/UploadProgress/dialog.tsx b/web/apps/photos/src/components/Upload/UploadProgress/dialog.tsxindex 5c9fb73e95..314f0da050 100644--- a/web/apps/photos/src/components/Upload/UploadProgress/dialog.tsx+++ b/web/apps/photos/src/components/Upload/UploadProgress/dialog.tsx@@ -2,13 +2,18 @@ import { UPLOAD_RESULT } from "@/new/photos/services/upload/types";import { VerticallyCenteredFlex } from "@ente/shared/components/Container";import ExpandMoreIcon from "@mui/icons-material/ExpandMore";import {+ Accordion,+ AccordionDetails,+ AccordionSummary,Button,Dialog,DialogActions,DialogContent,styled,Typography,+ type AccordionProps,type DialogProps,+ type TypographyProps,} from "@mui/material";import ItemList from "components/ItemList";import { t } from "i18next";@@ -16,12 +21,6 @@ import React, { useContext, useEffect, useState } from "react";import { Trans } from "react-i18next";import UploadProgressContext from "./context";import { UploadProgressHeader } from "./header";-import {- SectionInfo,- UploadProgressSection,- UploadProgressSectionContent,- UploadProgressSectionTitle,-} from "./section";export function UploadProgressDialog() {const { open, onClose, uploadPhase, finishedUploads } = useContext(@@ -112,7 +111,7 @@ export function UploadProgressDialog() {/></DialogContent>)}- {uploadPhase == "done" && <UploadProgressFooter />}+ {uploadPhase == "done" && <DoneFooter />}</Dialog>);}@@ -188,6 +187,35 @@ const InProgressItemContainer = styled("div")`}`;+const UploadProgressSection = styled((props: AccordionProps) => (+ <Accordion disableGutters elevation={0} square {...props} />+))(({ theme }) => ({+ borderTop: `1px solid ${theme.palette.divider}`,+ "&:last-child": {+ borderBottom: `1px solid ${theme.palette.divider}`,+ },+ "&:before": {+ display: "none",+ },+}));++const UploadProgressSectionTitle = styled(AccordionSummary)(() => ({+ backgroundColor: "rgba(255, 255, 255, .05)",+}));++const UploadProgressSectionContent = styled(AccordionDetails)(({ theme }) => ({+ padding: theme.spacing(2),+}));++const SectionInfo = (props: TypographyProps) => (+ <Typography+ color={"text.muted"}+ variant="small"+ {...props}+ sx={{ mb: 1 }}+ />+);+const NotUploadSectionHeader = styled("div")(({ theme }) => `text-align: center;@@ -197,28 +225,6 @@ const NotUploadSectionHeader = styled("div")(`,);-const UploadProgressFooter: React.FC = () => {- const { uploadPhase, finishedUploads, retryFailed, onClose } = useContext(- UploadProgressContext,- );-- return (- <DialogActions>- {uploadPhase == "done" &&- (finishedUploads?.get(UPLOAD_RESULT.FAILED)?.length > 0 ||- finishedUploads?.get(UPLOAD_RESULT.BLOCKED)?.length > 0 ? (- <Button variant="contained" fullWidth onClick={retryFailed}>- {t("RETRY_FAILED")}- </Button>- ) : (- <Button variant="contained" fullWidth onClick={onClose}>- {t("close")}- </Button>- ))}- </DialogActions>- );-};-interface ResultSectionProps {uploadResult: UPLOAD_RESULT;sectionTitle: string;@@ -301,3 +307,25 @@ const TitleText: React.FC<TitleTextProps> = ({ title, count }) => (</Typography></VerticallyCenteredFlex>);++const DoneFooter: React.FC = () => {+ const { uploadPhase, finishedUploads, retryFailed, onClose } = useContext(+ UploadProgressContext,+ );++ return (+ <DialogActions>+ {uploadPhase == "done" &&+ (finishedUploads?.get(UPLOAD_RESULT.FAILED)?.length > 0 ||+ finishedUploads?.get(UPLOAD_RESULT.BLOCKED)?.length > 0 ? (+ <Button variant="contained" fullWidth onClick={retryFailed}>+ {t("RETRY_FAILED")}+ </Button>+ ) : (+ <Button variant="contained" fullWidth onClick={onClose}>+ {t("close")}+ </Button>+ ))}+ </DialogActions>+ );+};diff --git a/web/apps/photos/src/components/Upload/UploadProgress/section.tsx b/web/apps/photos/src/components/Upload/UploadProgress/section.tsxdeleted file mode 100644index ec3587fb14..0000000000--- a/web/apps/photos/src/components/Upload/UploadProgress/section.tsx+++ /dev/null@@ -1,35 +0,0 @@-import { Typography, styled, type TypographyProps } from "@mui/material";-import MuiAccordion, { AccordionProps } from "@mui/material/Accordion";-import MuiAccordionDetails from "@mui/material/AccordionDetails";-import MuiAccordionSummary from "@mui/material/AccordionSummary";--export const UploadProgressSection = styled((props: AccordionProps) => (- <MuiAccordion disableGutters elevation={0} square {...props} />-))(({ theme }) => ({- borderTop: `1px solid ${theme.palette.divider}`,- "&:last-child": {- borderBottom: `1px solid ${theme.palette.divider}`,- },- "&:before": {- display: "none",- },-}));--export const UploadProgressSectionTitle = styled(MuiAccordionSummary)(() => ({- backgroundColor: "rgba(255, 255, 255, .05)",-}));--export const UploadProgressSectionContent = styled(MuiAccordionDetails)(- ({ theme }) => ({- padding: theme.spacing(2),- }),-);--export const SectionInfo = (props: TypographyProps) => (- <Typography- color={"text.muted"}- variant="small"- {...props}- sx={{ mb: 1 }}- />-);