Skip to content

armgit / ente

Public Imported from GitHub
0

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

Handle social login errors inline

Anand Baburajan34411861ca8d
diff --git a/web/apps/social/src/pages/login.tsx b/web/apps/social/src/pages/login.tsx
index 739ad654c1..d09692f8e6 100644
--- a/web/apps/social/src/pages/login.tsx
+++ b/web/apps/social/src/pages/login.tsx
@@ -18,6 +18,11 @@ const Page: React.FC = () => {
const [loginError, setLoginError] = useState<string>();
const [isSubmitting, setIsSubmitting] = useState(false);
+ const loginErrorMessage = (error: unknown) =>
+ error instanceof Error
+ ? error.message
+ : "Couldn't sign in. Please try again.";
+
const handleLoginResult = (
result: SocialLoginResult,
credentials: SocialLoginCredentials,
@@ -71,12 +76,7 @@ const Page: React.FC = () => {
credentials,
);
} catch (error) {
- console.error("Social login failed", error);
- setLoginError(
- error instanceof Error
- ? error.message
- : "Couldn't sign in. Please try again.",
- );
+ setLoginError(loginErrorMessage(error));
setIsSubmitting(false);
}
}}
diff --git a/web/apps/social/src/screens/FriendsScreen.tsx b/web/apps/social/src/screens/FriendsScreen.tsx
index ecd16c7481..b49323dca8 100644
--- a/web/apps/social/src/screens/FriendsScreen.tsx
+++ b/web/apps/social/src/screens/FriendsScreen.tsx
@@ -342,6 +342,7 @@ export const FriendsScreen: React.FC<FriendsScreenProps> = ({
boxSizing: "border-box",
minHeight: "100svh",
mx: "auto",
+ position: "relative",
width: "100%",
"@media (min-width: 600px)": { maxWidth: 390 },
}}
@@ -428,13 +429,18 @@ export const FriendsScreen: React.FC<FriendsScreenProps> = ({
) : (
<Box
sx={{
+ alignItems: "center",
color: textSoft,
+ display: "flex",
+ inset: 0,
+ justifyContent: "center",
fontFamily: '"Inter Variable", Inter, sans-serif',
fontSize: 14,
fontWeight: 600,
lineHeight: "20px",
+ pointerEvents: "none",
+ position: "absolute",
px: "24px",
- py: "44px",
textAlign: "center",
}}
>