From 689c985dca5ee8a12273be331e2933b7e7fb03f9 Mon Sep 17 00:00:00 2001 From: Lluis Agusti Date: Tue, 1 Jul 2025 20:00:24 +0400 Subject: [PATCH] chore: more wip --- .../src/app/(platform)/login/page.tsx | 8 +- .../app/(platform)/reset-password/page.tsx | 10 +- .../signup/components/LoadingSignup.tsx | 29 +++++ .../src/app/(platform)/signup/page.tsx | 119 +++++++++++------- .../src/components/atoms/Input/Input.tsx | 30 +++-- .../frontend/src/components/auth/AuthCard.tsx | 11 +- 6 files changed, 142 insertions(+), 65 deletions(-) create mode 100644 autogpt_platform/frontend/src/app/(platform)/signup/components/LoadingSignup.tsx diff --git a/autogpt_platform/frontend/src/app/(platform)/login/page.tsx b/autogpt_platform/frontend/src/app/(platform)/login/page.tsx index 14988eab90..135198b54c 100644 --- a/autogpt_platform/frontend/src/app/(platform)/login/page.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/login/page.tsx @@ -1,6 +1,7 @@ "use client"; import { Button } from "@/components/atoms/Button/Button"; import { Input } from "@/components/atoms/Input/Input"; +import { Link } from "@/components/atoms/Link/Link"; import { AuthCard } from "@/components/auth/AuthCard"; import AuthFeedback from "@/components/auth/AuthFeedback"; import { EmailNotAllowedModal } from "@/components/auth/EmailNotAllowedModal"; @@ -61,7 +62,7 @@ export default function LoginPage() { ) : null}
- + + Forgot password? + + } {...field} /> )} diff --git a/autogpt_platform/frontend/src/app/(platform)/reset-password/page.tsx b/autogpt_platform/frontend/src/app/(platform)/reset-password/page.tsx index 33e66b7c53..720d70102b 100644 --- a/autogpt_platform/frontend/src/app/(platform)/reset-password/page.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/reset-password/page.tsx @@ -160,7 +160,10 @@ export default function ResetPasswordPage() {
{user ? ( - + ) : ( -
+ + + + +
+
+ + +
+
+ + +
+ + +
+ + +
+
+
+
+ ); +} diff --git a/autogpt_platform/frontend/src/app/(platform)/signup/page.tsx b/autogpt_platform/frontend/src/app/(platform)/signup/page.tsx index 05bdf3f046..8976355e40 100644 --- a/autogpt_platform/frontend/src/app/(platform)/signup/page.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/signup/page.tsx @@ -2,6 +2,8 @@ import { Button } from "@/components/atoms/Button/Button"; import { Input } from "@/components/atoms/Input/Input"; +import { Link } from "@/components/atoms/Link/Link"; +import { Text } from "@/components/atoms/Text/Text"; import { AuthCard } from "@/components/auth/AuthCard"; import AuthFeedback from "@/components/auth/AuthFeedback"; import { EmailNotAllowedModal } from "@/components/auth/EmailNotAllowedModal"; @@ -15,11 +17,10 @@ import { FormField, FormItem, FormLabel, - FormMessage, } from "@/components/ui/form"; -import LoadingBox from "@/components/ui/loading"; import { getBehaveAs } from "@/lib/utils"; -import Link from "next/link"; +import { WarningOctagonIcon } from "@phosphor-icons/react/dist/ssr"; +import { LoadingSignup } from "./components/LoadingSignup"; import { useSignupPage } from "./useSignupPage"; export default function SignupPage() { @@ -41,7 +42,7 @@ export default function SignupPage() { } = useSignupPage(); if (isUserLoading || isLoggedIn) { - return ; + return ; } if (!isSupabaseAvailable) { @@ -52,6 +53,10 @@ export default function SignupPage() { ); } + const confirmPasswordError = form.formState.errors.confirmPassword?.message; + const withConfirmPassword = form.getValues("confirmPassword").length > 0; + const termsError = form.formState.errors.agreeToTerms?.message; + return (
@@ -73,7 +78,7 @@ export default function SignupPage() { ) : null} - + -

- Password needs to be at least 12 characters long -

+ {!confirmPasswordError && !withConfirmPassword ? ( + + Password needs to be at least 12 characters long + + ) : null}
)} /> + ( + <> + + + + +
+ + + I agree to the + + + Terms of Use + + + and + + + Privacy Policy + + +
+
+ {termsError ? ( +
+ + + {termsError} + +
+ ) : null} + + )} + /> + {/* Turnstile CAPTCHA Component */} Sign up - ( - - - - -
- - - I agree to the - - - Terms of Use - - - and - - - Privacy Policy - - - -
-
- )} - /> +
{input} - {error && ( - - {error} - - )} + + {error || " "}{" "} + {/* Always render with space to maintain consistent height calculation */} +
); @@ -62,9 +71,12 @@ export function Input({ inputWithError ) : ( ); diff --git a/autogpt_platform/frontend/src/components/auth/AuthCard.tsx b/autogpt_platform/frontend/src/components/auth/AuthCard.tsx index d9e510fd7b..40552b2bc9 100644 --- a/autogpt_platform/frontend/src/components/auth/AuthCard.tsx +++ b/autogpt_platform/frontend/src/components/auth/AuthCard.tsx @@ -19,17 +19,14 @@ AuthCard.BottomText = function BottomText({
- + {text} - + {link ? ( - + {link.text} ) : null}