diff --git a/src/components/Banner/Banner.tsx b/src/components/Banner/Banner.tsx index 29ea1bb..08b0502 100644 --- a/src/components/Banner/Banner.tsx +++ b/src/components/Banner/Banner.tsx @@ -17,10 +17,13 @@ const bannerStyles = tv({ base: "flex gap-2 p-3 pr-4 items-start w-full text-sm rounded-lg bg-gray-3 dark:bg-graydark-3 text-gray-dim", variants: { variant: { - info: "bg-blue-3 dark:bg-bluedark-3 text-blue-normal", - success: "bg-green-3 dark:bg-greendark-3 text-green-normal", - danger: "bg-red-3 dark:bg-reddark-3 text-red-normal", - warning: "bg-amber-3 dark:bg-amberdark-3 text-amber-normal", + info: "bg-blue-3 dark:bg-bluedark-3 text-blue-normal [&_a]:text-blue-normal", + success: + "bg-green-3 dark:bg-greendark-3 text-green-normal [&_a]:text-green-normal", + danger: + "bg-red-3 dark:bg-reddark-3 text-red-normal [&_a]:text-red-normal", + warning: + "bg-amber-3 dark:bg-amberdark-3 text-amber-normal [&_a]:text-amber-normal", }, }, defaultVariants: { diff --git a/src/routes/_unauthenticated/signin.tsx b/src/routes/_unauthenticated/signin.tsx index 71c7d54..2f84c79 100644 --- a/src/routes/_unauthenticated/signin.tsx +++ b/src/routes/_unauthenticated/signin.tsx @@ -12,6 +12,7 @@ import { TextField, } from "@/components"; import { useAuthActions } from "@convex-dev/auth/react"; +import { RiArrowLeftSLine } from "@remixicon/react"; import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { useConvexAuth } from "convex/react"; import { ConvexError } from "convex/values"; @@ -31,14 +32,15 @@ const SignIn = () => { const [isSubmitting, setIsSubmitting] = useState(false); const [error, setError] = useState(null); const navigate = useNavigate({ from: "/signin" }); - - if (flow === "reset") - return setFlow("signIn")} />; + const isClosed = process.env.NODE_ENV === "production"; useEffect(() => { if (isAuthenticated) navigate({ to: "/quests" }); }, [isAuthenticated, navigate]); + if (flow === "reset") + return setFlow("signIn")} />; + const handleSubmit = async (event: React.FormEvent) => { event.preventDefault(); setIsSubmitting(true); @@ -67,11 +69,10 @@ const SignIn = () => { console.error(error); if (error instanceof ConvexError) { setError(error.message); - setIsSubmitting(false); } else { setError("Something went wrong. Try again."); - setIsSubmitting(false); } + setIsSubmitting(false); } }; @@ -117,44 +118,44 @@ const SignIn = () => { -
- - - - + {isClosed ? ( + +

+ Namesake is in active development and currently closed to + signups. For name change support, join us on{" "} + Discord. +

+
+ ) : ( +
+ + + + + )}
); }; -const ClosedSignups = () => ( - -

- Namesake is in active development and currently closed to signups. For - name change support, join us on{" "} - Discord. -

-
-); - const ForgotPassword = ({ onBack }: { onBack: () => void }) => { const navigate = useNavigate({ from: "/signin" }); const { signIn } = useAuthActions(); @@ -184,13 +185,26 @@ const ForgotPassword = ({ onBack }: { onBack: () => void }) => { }) .catch((error) => { console.error(error); - setError(`Couldn't send code. Try again.`); + if (error instanceof ConvexError) { + setError(error.message); + } else { + setError("Couldn't send code. Is this email correct?"); + } setIsSubmitting(false); }) .finally(() => setIsSubmitting(false)); }} > -

Reset password

+
+
{error && {error}} void }) => { - ) : ( @@ -262,12 +275,10 @@ const ForgotPassword = ({ onBack }: { onBack: () => void }) => { }; function LoginRoute() { - const isClosed = process.env.NODE_ENV === "production"; - return (
- {isClosed ? : } +
{`Namesake v${APP_VERSION}`} Support