Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(frontend): Update login and signup feedback (#9917)

Krzysztof Czerwinskic4bbfd505058
diff --git a/autogpt_platform/frontend/src/app/(platform)/login/page.tsx b/autogpt_platform/frontend/src/app/(platform)/login/page.tsx
index 6027c26b6d..8543b77cf6 100644
--- a/autogpt_platform/frontend/src/app/(platform)/login/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/login/page.tsx
@@ -176,6 +176,7 @@ export default function LoginPage() {
</AuthButton>
</form>
<AuthFeedback
+ type="login"
message={feedback}
isError={!!feedback}
behaveAs={getBehaveAs()}
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 4b3d33208e..753faaed42 100644
--- a/autogpt_platform/frontend/src/app/(platform)/reset_password/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/reset_password/page.tsx
@@ -200,6 +200,7 @@ export default function ResetPasswordPage() {
Update password
</AuthButton>
<AuthFeedback
+ type="login"
message={feedback}
isError={isError}
behaveAs={getBehaveAs()}
@@ -242,6 +243,7 @@ export default function ResetPasswordPage() {
Send reset email
</AuthButton>
<AuthFeedback
+ type="login"
message={feedback}
isError={isError}
behaveAs={getBehaveAs()}
diff --git a/autogpt_platform/frontend/src/app/(platform)/signup/page.tsx b/autogpt_platform/frontend/src/app/(platform)/signup/page.tsx
index 02fe8d684f..ea8692767e 100644
--- a/autogpt_platform/frontend/src/app/(platform)/signup/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/signup/page.tsx
@@ -106,7 +106,7 @@ export default function SignupPage() {
}
return (
- <AuthCard className="mx-auto">
+ <AuthCard className="mx-auto mt-12">
<AuthHeader>Create a new account</AuthHeader>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSignup)}>
@@ -215,6 +215,7 @@ export default function SignupPage() {
</form>
</Form>
<AuthFeedback
+ type="signup"
message={feedback}
isError={!!feedback}
behaveAs={getBehaveAs()}
diff --git a/autogpt_platform/frontend/src/components/auth/AuthFeedback.tsx b/autogpt_platform/frontend/src/components/auth/AuthFeedback.tsx
index 835ed118dd..3b518b4e09 100644
--- a/autogpt_platform/frontend/src/components/auth/AuthFeedback.tsx
+++ b/autogpt_platform/frontend/src/components/auth/AuthFeedback.tsx
@@ -1,16 +1,17 @@
import { AlertCircle, CheckCircle } from "lucide-react";
-import { Card, CardContent } from "@/components/ui/card";
+import { Card, CardContent, CardHeader } from "@/components/ui/card";
import { HelpItem } from "@/components/auth/help-item";
-import Link from "next/link";
import { BehaveAs } from "@/lib/utils";
interface Props {
+ type: "login" | "signup";
message?: string | null;
isError?: boolean;
behaveAs?: BehaveAs;
}
export default function AuthFeedback({
+ type,
message = "",
isError = false,
behaveAs = BehaveAs.CLOUD,
@@ -39,48 +40,45 @@ export default function AuthFeedback({
)}
{/* Cloud-specific help */}
- {isError && behaveAs === BehaveAs.CLOUD && (
- <div className="mt-2 space-y-2 text-sm">
- <span className="block text-center font-medium text-red-500">
- The provided email may not be allowed to sign up.
- </span>
- <ul className="space-y-2 text-slate-700">
- <li className="flex items-start">
- <span className="mr-2">-</span>
- <span>
- AutoGPT Platform is currently in closed beta. You can join{" "}
- <Link
+ {isError &&
+ behaveAs === BehaveAs.CLOUD &&
+ (type === "signup" ? (
+ <Card className="overflow-hidden rounded-lg border border-slate-200 bg-white shadow-sm">
+ <CardContent className="p-0">
+ <div className="divide-y divide-slate-100">
+ <span className="my-3 block text-center text-sm font-medium text-red-500">
+ The provided email may not be allowed to sign up.
+ </span>
+ <HelpItem
+ title="AutoGPT Platform is currently in closed beta. "
+ description="You can join "
+ linkText="the waitlist here"
href="https://agpt.co/waitlist"
- className="font-medium text-slate-950 underline hover:text-slate-700"
- >
- the waitlist here
- </Link>
- .
- </span>
- </li>
- <li className="flex items-start">
- <span className="mr-2">-</span>
- <span>
- Make sure you use the same email address you used to sign up for
- the waitlist.
- </span>
- </li>
- <li className="flex items-start">
- <span className="mr-2">-</span>
- <span>
- You can self host the platform, visit our{" "}
- <Link
+ />
+ <HelpItem title="Make sure you use the same email address you used to sign up for the waitlist." />
+ <HelpItem
+ title="You can self host the platform!"
+ description="Visit our"
+ linkText="GitHub repository"
href="https://github.com/Significant-Gravitas/AutoGPT"
- className="font-medium text-slate-950 underline hover:text-slate-700"
- >
- GitHub repository
- </Link>
- .
- </span>
- </li>
- </ul>
- </div>
- )}
+ />
+ </div>
+ </CardContent>
+ </Card>
+ ) : (
+ <Card className="overflow-hidden rounded-lg border border-slate-200 bg-white shadow-sm">
+ <CardContent className="p-0">
+ <div className="divide-y divide-slate-100">
+ <HelpItem
+ title="Having trouble logging in?"
+ description="Make sure you've already "
+ linkText="signed up"
+ href="/signup"
+ />
+ </div>
+ </CardContent>
+ </Card>
+ ))}
{/* Local-specific help */}
{isError && behaveAs === BehaveAs.LOCAL && (
diff --git a/autogpt_platform/frontend/src/components/auth/help-item.tsx b/autogpt_platform/frontend/src/components/auth/help-item.tsx
index 12c791fe44..51f4fef37a 100644
--- a/autogpt_platform/frontend/src/components/auth/help-item.tsx
+++ b/autogpt_platform/frontend/src/components/auth/help-item.tsx
@@ -3,29 +3,33 @@ import Link from "next/link";
interface HelpItemProps {
title: string;
- description: string;
- linkText: string;
- href: string;
+ description?: string;
+ linkText?: string;
+ href?: string;
}
export function HelpItem({
title,
description,
linkText,
- href,
+ href = "",
}: HelpItemProps) {
+ const external = !href.startsWith("/");
+
return (
<div className="p-4">
<h3 className="mb-1 text-sm font-medium text-slate-950">{title}</h3>
<p className="text-sm text-slate-600">
{description}{" "}
- <Link
- href={href}
- className="inline-flex items-center font-medium text-slate-950 hover:text-slate-700"
- >
- {linkText}
- <ExternalLink className="ml-1 h-3 w-3" />
- </Link>
+ {linkText && (
+ <Link
+ href={href}
+ className="inline-flex items-center font-medium text-slate-950 hover:text-slate-700"
+ >
+ {linkText}
+ {external && <ExternalLink className="ml-1 h-3 w-3" />}
+ </Link>
+ )}
</p>
</div>
);