Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(appLock):prettified

Aswin Asok1ed48f5fc192
diff --git a/web/packages/new/photos/components/app-lock/AppLockFeedback.tsx b/web/packages/new/photos/components/app-lock/AppLockFeedback.tsx
index 77e15e506c..628b95ccb2 100644
--- a/web/packages/new/photos/components/app-lock/AppLockFeedback.tsx
+++ b/web/packages/new/photos/components/app-lock/AppLockFeedback.tsx
@@ -6,11 +6,7 @@ import {
CooldownIllustration,
LogoutIllustration,
} from "./AppLockIllustrations";
-import {
- LOGOUT_MODAL_WIDTH,
- subtitleTextSx,
- titleTextSx,
-} from "./styles";
+import { LOGOUT_MODAL_WIDTH, subtitleTextSx, titleTextSx } from "./styles";
const DANGER_RED = "#E53935";
const DANGER_RED_HOVER = "#D32F2F";
@@ -142,7 +138,9 @@ export const AppLockLogoutConfirmation = ({
}}
>
<Typography sx={titleTextSx}>{t("logout")}</Typography>
- <Typography sx={subtitleTextSx}>{t("logout_message")}</Typography>
+ <Typography sx={subtitleTextSx}>
+ {t("logout_message")}
+ </Typography>
</Box>
<Stack spacing={1.5} sx={{ width: "100%" }}>
@@ -212,7 +210,9 @@ export const CooldownScreen = ({
mb: 2.5,
}}
>
- <Typography sx={(theme) => ({ ...titleTextSx(theme), mb: 0.5 })}>
+ <Typography
+ sx={(theme) => ({ ...titleTextSx(theme), mb: 0.5 })}
+ >
{t("app_locked")}
</Typography>
<Typography
diff --git a/web/packages/new/photos/components/app-lock/AppLockPrompt.tsx b/web/packages/new/photos/components/app-lock/AppLockPrompt.tsx
index 3caa92d4bb..cbfbe84677 100644
--- a/web/packages/new/photos/components/app-lock/AppLockPrompt.tsx
+++ b/web/packages/new/photos/components/app-lock/AppLockPrompt.tsx
@@ -5,9 +5,9 @@ import { t } from "i18next";
import type { ReactNode } from "react";
import { useCallback, useEffect, useState } from "react";
import { cancelReauthentication } from "../../services/app-lock";
+import { useAppLockSnapshot } from "../utils/use-snapshot";
import { AppLockLogoutConfirmation } from "./AppLockFeedback";
import { AppLockUnlockForm } from "./AppLockUnlockForm";
-import { useAppLockSnapshot } from "../utils/use-snapshot";
type AppLockSnapshot = ReturnType<typeof useAppLockSnapshot>;
@@ -31,9 +31,7 @@ const AppLockCloseAction = () => (
...theme.applyStyles("dark", {
backgroundColor: "rgba(255, 255, 255, 0.12)",
color: "#fff",
- "&:hover": {
- backgroundColor: "rgba(255, 255, 255, 0.16)",
- },
+ "&:hover": { backgroundColor: "rgba(255, 255, 255, 0.16)" },
}),
})}
>
@@ -65,7 +63,9 @@ export const AppLockPrompt = ({
if (!isVisible) return null;
const closeAction =
- isReauthentication && !showLogoutConfirm ? <AppLockCloseAction /> : undefined;
+ isReauthentication && !showLogoutConfirm ? (
+ <AppLockCloseAction />
+ ) : undefined;
return (
<>
diff --git a/web/packages/new/photos/components/app-lock/AppLockReauthenticationDialog.tsx b/web/packages/new/photos/components/app-lock/AppLockReauthenticationDialog.tsx
index 4437d4a87d..91252cff45 100644
--- a/web/packages/new/photos/components/app-lock/AppLockReauthenticationDialog.tsx
+++ b/web/packages/new/photos/components/app-lock/AppLockReauthenticationDialog.tsx
@@ -5,8 +5,8 @@
import { Box, Modal } from "@mui/material";
import { t } from "i18next";
import type { CSSProperties } from "react";
-import { AppLockPrompt } from "./AppLockPrompt";
import { useAppLockSnapshot } from "../utils/use-snapshot";
+import { AppLockPrompt } from "./AppLockPrompt";
export const AppLockReauthenticationDialog = () => {
const appLock = useAppLockSnapshot();
diff --git a/web/packages/new/photos/components/app-lock/AppLockUnlockForm.tsx b/web/packages/new/photos/components/app-lock/AppLockUnlockForm.tsx
index bc00718ecc..f3f9679e71 100644
--- a/web/packages/new/photos/components/app-lock/AppLockUnlockForm.tsx
+++ b/web/packages/new/photos/components/app-lock/AppLockUnlockForm.tsx
@@ -1,4 +1,10 @@
-import { Box, CircularProgress, Stack, TextField, Typography } from "@mui/material";
+import {
+ Box,
+ CircularProgress,
+ Stack,
+ TextField,
+ Typography,
+} from "@mui/material";
import { FocusVisibleButton } from "ente-base/components/mui/FocusVisibleButton";
import { ShowHidePasswordInputAdornment } from "ente-base/components/mui/PasswordInputAdornment";
import { useBaseContext } from "ente-base/context";
@@ -12,15 +18,11 @@ import {
type DeviceLockUnlockResult,
type UnlockResult,
} from "../../services/app-lock";
+import { useAppLockSnapshot } from "../utils/use-snapshot";
import { AppLockCard } from "./AppLockCard";
import { CooldownScreen, ErrorMessage } from "./AppLockFeedback";
-import {
- LOGOUT_MODAL_WIDTH,
- subtitleTextSx,
- titleTextSx,
-} from "./styles";
import { LockIllustration } from "./AppLockIllustrations";
-import { useAppLockSnapshot } from "../utils/use-snapshot";
+import { LOGOUT_MODAL_WIDTH, subtitleTextSx, titleTextSx } from "./styles";
type AppLockSnapshot = ReturnType<typeof useAppLockSnapshot>;
@@ -44,10 +46,7 @@ interface AppLockFormHeaderProps {
const ENTE_GREEN = "#08C225";
const ENTE_GREEN_HOVER = "#07A820";
-const appLockModalContentSx = {
- width: 408 - 32,
- maxWidth: "100%",
-} as const;
+const appLockModalContentSx = { width: 408 - 32, maxWidth: "100%" } as const;
const useCooldownState = (
cooldownExpiresAt: number,
@@ -381,7 +380,9 @@ const PinUnlockContent = ({
>
<AppLockFormHeader
title={
- isReauthentication ? t("authenticate") : t("app_locked")
+ isReauthentication
+ ? t("authenticate")
+ : t("app_locked")
}
subtitle={t("app_lock_enter_pin_to_unlock")}
isReauthentication={isReauthentication}
@@ -406,7 +407,9 @@ const PinUnlockContent = ({
inputRefs.current[i] = el;
}}
value={digit}
- onChange={(e) => handlePinChange(i, e.target.value)}
+ onChange={(e) =>
+ handlePinChange(i, e.target.value)
+ }
onKeyDown={(e) => handleKeyDown(i, e)}
disabled={loading}
slotProps={{
@@ -426,7 +429,9 @@ const PinUnlockContent = ({
},
}}
sx={(theme) => ({
- ...inputFieldSx(theme, { borderRadius: 12 }),
+ ...inputFieldSx(theme, {
+ borderRadius: 12,
+ }),
flex: 1,
minWidth: 0,
"& .MuiInputBase-input": {
@@ -520,7 +525,9 @@ const PasswordUnlockContent = ({
sx={appLockModalContentSx}
>
<AppLockFormHeader
- title={isReauthentication ? t("password") : t("app_locked")}
+ title={
+ isReauthentication ? t("password") : t("app_locked")
+ }
subtitle={t("app_lock_enter_password")}
isReauthentication={isReauthentication}
marginBottom={2}
@@ -541,7 +548,9 @@ const PasswordUnlockContent = ({
}}
disabled={loading}
placeholder={
- isReauthentication ? t("password") : t("app_lock_password")
+ isReauthentication
+ ? t("password")
+ : t("app_lock_password")
}
autoComplete="off"
slotProps={{
@@ -549,7 +558,9 @@ const PasswordUnlockContent = ({
endAdornment: (
<ShowHidePasswordInputAdornment
showPassword={showPassword}
- onToggle={() => setShowPassword((s) => !s)}
+ onToggle={() =>
+ setShowPassword((s) => !s)
+ }
/>
),
},
@@ -669,7 +680,9 @@ const DeviceLockUnlockContent = ({
>
<AppLockFormHeader
title={
- isReauthentication ? t("authenticate") : t("app_locked")
+ isReauthentication
+ ? t("authenticate")
+ : t("app_locked")
}
subtitle={t("device_lock_login_instructions")}
isReauthentication={isReauthentication}