Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fin

Manav Rathi851ca1afe282
diff --git a/web/packages/base/components/mui/LoadingButton.tsx b/web/packages/base/components/mui/LoadingButton.tsx
index 319c8538bf..dddb2b1b07 100644
--- a/web/packages/base/components/mui/LoadingButton.tsx
+++ b/web/packages/base/components/mui/LoadingButton.tsx
@@ -8,9 +8,8 @@ import React from "react";
*
* The button is also disabled when in the loading state.
*
- * TODO: This duplicates the existing SubmitButton and EnteButton. Merge these
- * three gradually (didn't want to break existing layouts, so will do it
- * piecewise).
+ * TODO: This duplicates the existing SubmitButton. Merge these two gradually
+ * (didn't want to break existing layouts, so will do it piecewise).
*/
export const LoadingButton: React.FC<ButtonProps & { loading?: boolean }> = ({
loading,
diff --git a/web/packages/shared/components/EnteButton.tsx b/web/packages/shared/components/EnteButton.tsx
deleted file mode 100644
index 365d648a3c..0000000000
--- a/web/packages/shared/components/EnteButton.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { ensure } from "@/utils/ensure";
-import Done from "@mui/icons-material/Done";
-import { Button, CircularProgress, type ButtonProps } from "@mui/material";
-
-interface Iprops extends ButtonProps {
- loading?: boolean;
- success?: boolean;
-}
-
-export default function EnteButton({
- children,
- loading,
- success,
- disabled,
- sx,
- ...props
-}: Iprops) {
- return (
- <Button
- disabled={disabled}
- sx={{
- ...sx,
- ...((loading || success) && {
- "&.Mui-disabled": (theme) => ({
- // TODO: Refactor to not need this ensure.
- backgroundColor:
- theme.palette[ensure(props.color)].main,
- color: theme.palette[ensure(props.color)].contrastText,
- }),
- }),
- }}
- {...props}
- >
- {loading ? (
- <CircularProgress size={20} sx={{ color: "inherit" }} />
- ) : success ? (
- <Done sx={{ fontSize: 20 }} />
- ) : (
- children
- )}
- </Button>
- );
-}
diff --git a/web/packages/shared/components/LoginComponents.tsx b/web/packages/shared/components/LoginComponents.tsx
index cbe828cba7..528399fc98 100644
--- a/web/packages/shared/components/LoginComponents.tsx
+++ b/web/packages/shared/components/LoginComponents.tsx
@@ -3,9 +3,9 @@ import {
passkeySessionExpiredErrorMessage,
saveCredentialsAndNavigateTo,
} from "@/accounts/services/passkey";
+import { FocusVisibleButton } from "@/base/components/mui/FocusVisibleButton";
import log from "@/base/log";
import { customAPIHost } from "@/base/origins";
-import EnteButton from "@ente/shared/components/EnteButton";
import { CircularProgress, Stack, Typography, styled } from "@mui/material";
import { t } from "i18next";
import { useRouter } from "next/router";
@@ -140,23 +140,21 @@ export const VerifyingPasskey: React.FC<VerifyingPasskeyProps> = ({
</VerifyingPasskeyStatus>
<ButtonStack>
- <EnteButton
+ <FocusVisibleButton
onClick={handleRetry}
fullWidth
color="secondary"
- type="button"
>
{t("try_again")}
- </EnteButton>
+ </FocusVisibleButton>
- <EnteButton
+ <FocusVisibleButton
onClick={handleCheckStatus}
fullWidth
color="accent"
- type="button"
>
{t("check_status")}
- </EnteButton>
+ </FocusVisibleButton>
</ButtonStack>
</VerifyingPasskeyMiddle>