Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

fix: login toast

Dillion Verma0e42b13ae96f
diff --git a/components/user-auth-form.tsx b/components/user-auth-form.tsx
index 6b007dcf..547156df 100644
--- a/components/user-auth-form.tsx
+++ b/components/user-auth-form.tsx
@@ -3,13 +3,13 @@
import { Icons } from "@/components/icons";
import { buttonVariants } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
-import { toast } from "@/components/ui/use-toast";
import { cn } from "@/lib/utils";
import { userAuthSchema } from "@/lib/validations/auth";
import { zodResolver } from "@hookform/resolvers/zod";
import { signIn } from "next-auth/react";
import * as React from "react";
import { useForm } from "react-hook-form";
+import { toast } from "sonner";
import * as z from "zod";
import { Form, FormControl, FormField, FormItem, FormMessage } from "./ui/form";
@@ -39,15 +39,12 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
setIsLoading(false);
if (!signInResult?.ok) {
- return toast({
- title: "Something went wrong.",
+ return toast.error("Something went wrong.", {
description: "Your sign in request failed. Please try again.",
- variant: "destructive",
});
}
- return toast({
- title: "Check your email",
+ return toast.success("Check your email", {
description: "We sent you a login link. Be sure to check your spam too.",
});
}
diff --git a/content/docs/components/animated-beam.mdx b/content/docs/components/animated-beam.mdx
index 7e6e53fb..36a1c071 100644
--- a/content/docs/components/animated-beam.mdx
+++ b/content/docs/components/animated-beam.mdx
@@ -28,6 +28,8 @@ components/magicui/animated-beam.tsx
To create an animated beam, you need a container element with a ref, and two elements with refs that the beam will travel between.
```tsx
+"use client";
+
import { AnimatedBeam } from "@/components/magicui/animated-beam";
export default function AnimatedBeamDemo() {