π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix(auth):styles-updated-for-light-mode
Aswin Asokd39414eb7681
diff --git a/web/apps/auth/src/pages/login.tsx b/web/apps/auth/src/pages/login.tsxindex 9eeefffa72..3ca11be350 100644--- a/web/apps/auth/src/pages/login.tsx+++ b/web/apps/auth/src/pages/login.tsx@@ -12,12 +12,17 @@ import React, { useCallback, useEffect, useState } from "react";const AccountsPagePaper = styled(Paper)(({ theme }) => ({marginBlock: theme.spacing(2),- padding: theme.spacing(4, 2),- width: "min(375px, 80vw)",+ padding: theme.spacing(5, 3),+ [theme.breakpoints.up("sm")]: {+ padding: theme.spacing(5),+ },+ width: "min(420px, 85vw)",minHeight: "375px",display: "flex",flexDirection: "column",gap: theme.spacing(4),+ boxShadow: "none",+ borderRadius: "20px",}));const Page: React.FC = () => {@@ -68,21 +73,24 @@ const Page: React.FC = () => {return loading ? (<LoadingIndicator />) : (- <Stack sx={{ minHeight: "100svh" }}>+ <Stack+ sx={[+ { minHeight: "100svh", bgcolor: "secondary.main" },+ (theme) =>+ theme.applyStyles("dark", {+ bgcolor: "background.default",+ }),+ ]}+ ><NavbarBase- sx={[- (theme) =>- theme.applyStyles("light", {- borderBottomColor: "stroke.base",- }),- ]}+ sx={{ boxShadow: "none", borderBottom: "none", bgcolor: "transparent" }}><EnteLogo /></NavbarBase><CenteredFillonClick={handleBackgroundClick}sx={[- { bgcolor: "accent.main" },+ { bgcolor: "secondary.main" },(theme) =>theme.applyStyles("dark", {bgcolor: "background.default",diff --git a/web/packages/accounts/components/RecoveryKey.tsx b/web/packages/accounts/components/RecoveryKey.tsxindex 16c8899736..b4d4f40611 100644--- a/web/packages/accounts/components/RecoveryKey.tsx+++ b/web/packages/accounts/components/RecoveryKey.tsx@@ -1,17 +1,10 @@-import {- Dialog,- DialogActions,- DialogContent,- DialogTitle,- Stack,- Typography,-} from "@mui/material";+import { Paper, Stack, styled, Typography } from "@mui/material";import { type MiniDialogAttributes } from "ente-base/components/MiniDialog";-import { SpacedRow } from "ente-base/components/containers";-import { DialogCloseIconButton } from "ente-base/components/mui/DialogCloseIconButton";+import { CenteredFill } from "ente-base/components/containers";+import { EnteLogo } from "ente-base/components/EnteLogo";import { FocusVisibleButton } from "ente-base/components/mui/FocusVisibleButton";+import { NavbarBase } from "ente-base/components/Navbar";import { errorDialogAttributes } from "ente-base/components/utils/dialog";-import { useIsSmallWidth } from "ente-base/components/utils/hooks";import type { ModalVisibilityProps } from "ente-base/components/utils/modal";import log from "ente-base/log";import { saveStringAsFile } from "ente-base/utils/web";@@ -33,7 +26,6 @@ export const RecoveryKey: React.FC<RecoveryKeyProps> = ({showMiniDialog,}) => {const [recoveryKey, setRecoveryKey] = useState<string | undefined>();- const fullScreen = useIsSmallWidth();const handleLoadError = useCallback((e: unknown) => {@@ -59,61 +51,85 @@ export const RecoveryKey: React.FC<RecoveryKeyProps> = ({onClose();};+ if (!open) return null;+return (- <Dialog- fullScreen={fullScreen}- open={open}- onClose={onClose}- // [Note: maxWidth "xs" on MUI dialogs]- //- // While logically the "xs" breakpoint doesn't make sense as a- // maxWidth value (since as a breakpoint it's value is 0), in- // practice MUI has hardcoded its value to a reasonable 444px.- // https://github.com/mui/material-ui/issues/34646.- maxWidth="xs"- fullWidth+ <Stack+ sx={[+ { minHeight: "100svh", bgcolor: "secondary.main" },+ (theme) =>+ theme.applyStyles("dark", {+ bgcolor: "background.default",+ }),+ ]}>- <SpacedRow sx={{ p: "8px 4px 8px 0" }}>- <DialogTitle variant="h3">{t("recovery_key")}</DialogTitle>- <DialogCloseIconButton {...{ onClose }} />- </SpacedRow>- <DialogContent>- <Typography sx={{ mb: 3 }}>- {t("recovery_key_description")}- </Typography>- <Stack- sx={{- border: "1px dashed",- borderColor: "stroke.muted",- borderRadius: 1,- }}- >- <CodeBlock code={recoveryKey} />- <Typography sx={{ m: 2 }}>- {t("key_not_stored_note")}+ <NavbarBase+ sx={{ boxShadow: "none", borderBottom: "none", bgcolor: "transparent" }}+ >+ <EnteLogo />+ </NavbarBase>+ <CenteredFill+ sx={[+ { bgcolor: "secondary.main" },+ (theme) =>+ theme.applyStyles("dark", {+ bgcolor: "background.default",+ }),+ ]}+ >+ <RecoveryKeyPaper>+ <Typography variant="h3">{t("recovery_key")}</Typography>+ <Typography sx={{ color: "text.muted" }}>+ {t("recovery_key_description")}</Typography>- </Stack>- </DialogContent>- <DialogActions>- <FocusVisibleButton- color="secondary"- fullWidth- onClick={onClose}- >- {t("do_this_later")}- </FocusVisibleButton>- <FocusVisibleButton- color="accent"- fullWidth- onClick={handleSaveClick}- >- {t("save_key")}- </FocusVisibleButton>- </DialogActions>- </Dialog>+ <Stack+ sx={{+ border: "1px dashed",+ borderColor: "stroke.muted",+ borderRadius: 1,+ }}+ >+ <CodeBlock code={recoveryKey} />+ <Typography sx={{ m: 2 }}>+ {t("key_not_stored_note")}+ </Typography>+ </Stack>+ <Stack direction="row" sx={{ gap: 1, mt: 2 }}>+ <FocusVisibleButton+ color="secondary"+ fullWidth+ onClick={onClose}+ >+ {t("do_this_later")}+ </FocusVisibleButton>+ <FocusVisibleButton+ color="accent"+ fullWidth+ onClick={handleSaveClick}+ >+ {t("save_key")}+ </FocusVisibleButton>+ </Stack>+ </RecoveryKeyPaper>+ </CenteredFill>+ </Stack>);};+const RecoveryKeyPaper = styled(Paper)(({ theme }) => ({+ marginBlock: theme.spacing(2),+ padding: theme.spacing(5, 3),+ [theme.breakpoints.up("sm")]: {+ padding: theme.spacing(5),+ },+ width: "min(420px, 85vw)",+ display: "flex",+ flexDirection: "column",+ gap: theme.spacing(3),+ boxShadow: "none",+ borderRadius: "20px",+}));+const getUserRecoveryKeyMnemonic = async () =>recoveryKeyToMnemonic(await getUserRecoveryKey());diff --git a/web/packages/accounts/components/layouts/centered-paper.tsx b/web/packages/accounts/components/layouts/centered-paper.tsxindex 224fb82ff3..20d31f61e7 100644--- a/web/packages/accounts/components/layouts/centered-paper.tsx+++ b/web/packages/accounts/components/layouts/centered-paper.tsx@@ -19,20 +19,23 @@ import { NavbarBase } from "ente-base/components/Navbar";export const AccountsPageContents: React.FC<React.PropsWithChildren> = ({children,}) => (- <Stack sx={{ minHeight: "100svh" }}>+ <Stack+ sx={[+ { minHeight: "100svh", bgcolor: "secondary.main" },+ (theme) =>+ theme.applyStyles("dark", {+ bgcolor: "background.default",+ }),+ ]}+ ><NavbarBase- sx={[- (theme) =>- theme.applyStyles("light", {- borderBottomColor: "stroke.base",- }),- ]}+ sx={{ boxShadow: "none", borderBottom: "none", bgcolor: "transparent" }}><EnteLogo /></NavbarBase><CenteredFillsx={[- { bgcolor: "accent.main" },+ { bgcolor: "secondary.main" },(theme) =>theme.applyStyles("dark", {bgcolor: "background.default",@@ -46,12 +49,17 @@ export const AccountsPageContents: React.FC<React.PropsWithChildren> = ({const AccountsPagePaper = styled(Paper)(({ theme }) => ({marginBlock: theme.spacing(2),- padding: theme.spacing(4, 2),- width: "min(375px, 80vw)",+ padding: theme.spacing(5, 3),+ [theme.breakpoints.up("sm")]: {+ padding: theme.spacing(5),+ },+ width: "min(420px, 85vw)",minHeight: "375px",display: "flex",flexDirection: "column",gap: theme.spacing(4),+ boxShadow: "none",+ borderRadius: "20px",}));export const AccountsPageTitle: React.FC<React.PropsWithChildren> = ({diff --git a/web/packages/accounts/pages/two-factor/setup.tsx b/web/packages/accounts/pages/two-factor/setup.tsxindex 0c20ce93c9..895dcb3f4d 100644--- a/web/packages/accounts/pages/two-factor/setup.tsx+++ b/web/packages/accounts/pages/two-factor/setup.tsx@@ -8,9 +8,11 @@ import {setupTwoFactorFinish,} from "ente-accounts/services/user";import { CenteredFill } from "ente-base/components/containers";+import { EnteLogo } from "ente-base/components/EnteLogo";import { LinkButton } from "ente-base/components/LinkButton";import { ActivityIndicator } from "ente-base/components/mui/ActivityIndicator";import { FocusVisibleButton } from "ente-base/components/mui/FocusVisibleButton";+import { NavbarBase } from "ente-base/components/Navbar";import { t } from "i18next";import { useRouter } from "next/router";import React, { useEffect, useState } from "react";@@ -32,7 +34,20 @@ const Page: React.FC = () => {};return (- <Stack sx={{ minHeight: "100svh" }}>+ <Stack+ sx={[+ { minHeight: "100svh", bgcolor: "secondary.main" },+ (theme) =>+ theme.applyStyles("dark", {+ bgcolor: "background.default",+ }),+ ]}+ >+ <NavbarBase+ sx={{ boxShadow: "none", borderBottom: "none", bgcolor: "transparent" }}+ >+ <EnteLogo />+ </NavbarBase><CenteredFill><ContentsPaper><Typography variant="h5" sx={{ textAlign: "center" }}>@@ -61,12 +76,18 @@ export default Page;const ContentsPaper = styled(Paper)(({ theme }) => ({marginBlock: theme.spacing(2),- padding: theme.spacing(4, 2),+ padding: theme.spacing(5, 3),+ [theme.breakpoints.up("sm")]: {+ padding: theme.spacing(5),+ },// Wide enough to fit the QR code secret in one line under default settings.- width: "min(440px, 95vw)",+ width: "min(440px, 85vw)",+ minHeight: "375px",display: "flex",flexDirection: "column",gap: theme.spacing(4),+ boxShadow: "none",+ borderRadius: "20px",}));interface InstructionsProps {