diff options
| author | ni-zav <106657905+Ni-zav@users.noreply.github.com> | 2025-07-14 23:43:34 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-14 23:43:34 +0700 |
| commit | ffb254c339d362ea732ae447acd0710dbe635ab0 (patch) | |
| tree | f52d871c00f4b974f3c0143e579d79bb19c3d527 /apps/web/src/components/landing | |
| parent | acd42a29f6370417ef188d668c4567e9892a8ed1 (diff) | |
| parent | 416511084a3bf26fbbab2fcb861ad916dbe851f6 (diff) | |
| download | opencut-ffb254c339d362ea732ae447acd0710dbe635ab0.tar.gz | |
Merge branch 'OpenCut-app:main' into refactor/move-add-button
Diffstat (limited to 'apps/web/src/components/landing')
| -rw-r--r-- | apps/web/src/components/landing/hero.tsx | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/apps/web/src/components/landing/hero.tsx b/apps/web/src/components/landing/hero.tsx index 776cc654..01ad7e7e 100644 --- a/apps/web/src/components/landing/hero.tsx +++ b/apps/web/src/components/landing/hero.tsx @@ -5,7 +5,7 @@ import { Button } from "../ui/button"; import { Input } from "../ui/input"; import { ArrowRight } from "lucide-react"; import { useState } from "react"; -import { useToast } from "@/hooks/use-toast"; +import { toast } from "sonner"; import Image from "next/image"; import { Handlebars } from "./handlebars"; @@ -17,16 +17,13 @@ interface HeroProps { export function Hero({ signupCount }: HeroProps) { const [email, setEmail] = useState(""); const [isSubmitting, setIsSubmitting] = useState(false); - const { toast } = useToast(); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!email.trim()) { - toast({ - title: "Email required", + toast.error("Email required", { description: "Please enter your email address.", - variant: "destructive", }); return; } @@ -45,25 +42,20 @@ export function Hero({ signupCount }: HeroProps) { const data = (await response.json()) as { error: string }; if (response.ok) { - toast({ - title: "Welcome to the waitlist! 🎉", + toast.success("Welcome to the waitlist! 🎉", { description: "You'll be notified when we launch.", }); setEmail(""); } else { - toast({ - title: "Oops!", + toast.error("Oops!", { description: (data as { error: string }).error || "Something went wrong. Please try again.", - variant: "destructive", }); } } catch (error) { - toast({ - title: "Network error", + toast.error("Network error", { description: "Please check your connection and try again.", - variant: "destructive", }); } finally { setIsSubmitting(false); |
