diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index d6deb11..e603d74 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -1,32 +1,34 @@ 'use client'; import Link from 'next/link'; -import { useState } from 'react'; -import { joinWaitlist, trackEvent } from '@/lib/api'; +import { useEffect } from 'react'; +import { trackEvent } from '@/lib/api'; -export default function Home() { - const [email, setEmail] = useState(''); - const [loading, setLoading] = useState(false); - const [submitted, setSubmitted] = useState(false); - const [error, setError] = useState(''); - - const handleWaitlistSignup = async (e: React.FormEvent) => { - e.preventDefault(); - setLoading(true); - setError(''); - - const result = await joinWaitlist({ - email, - source: 'landing_page', - }); +// Declare Tally types for TypeScript +declare global { + interface Window { + Tally?: { + openPopup: (formId: string, options?: { width?: number }) => void; + }; + } +} - setLoading(false); +export default function Home() { + // Load Tally widget script + useEffect(() => { + const script = document.createElement('script'); + script.src = 'https://tally.so/widgets/embed.js'; + script.async = true; + document.body.appendChild(script); + return () => { + document.body.removeChild(script); + }; + }, []); - if (result.success) { - setSubmitted(true); - trackEvent('landing_page_waitlist_signup'); - } else { - setError(result.error?.message || 'Failed to join waitlist'); + const openWaitlist = () => { + trackEvent('waitlist_opened'); + if (window.Tally) { + window.Tally.openPopup('w56Pp6', { width: 600 }); } }; @@ -36,12 +38,12 @@ export default function Home() {

Unweighted

- - Get Started - + Join Waitlist +
@@ -57,13 +59,12 @@ export default function Home() { tailored to your goals, schedule, and fitness level in minutes.

- trackEvent('hero_cta_clicked')} > - Create Your Plan - + Join Waitlist + - {!submitted ? ( -
-
- setEmail(e.target.value)} - placeholder="Enter your email" - className="flex-1 px-4 py-3 rounded-lg text-gray-900" - required - /> - -
- {error &&

{error}

} -
- ) : ( -
-

You're on the list!

-

We'll notify you when new features are ready.

-
- )} +
@@ -257,9 +237,12 @@ export default function Home() { © 2025 Unweighted. Built for people who want real results.

- - Create Your Plan - +