-
-
-
- +
+
+
+
+
+ +
+ {
+ setCountryCode(e.target.value.replace(/[^0-9]/g, "").slice(0, 4));
+ setVerifyFeedback(null);
+ }}
+ onKeyDown={(e) => { if (e.key === "Enter" && fullPhone.trim()) handleStartLinking(); }}
+ className="w-full bg-transparent text-white text-sm px-1.5 py-2.5 focus:outline-none placeholder-slate-600"
+ placeholder="1"
+ aria-label="Country code"
+ />
+
+
+
+
+ {
+ setPhoneLocal(e.target.value.replace(/[^0-9]/g, ""));
+ setVerifyFeedback(null);
+ }}
+ onKeyDown={(e) => { if (e.key === "Enter" && fullPhone.trim()) handleStartLinking(); }}
+ className="w-full rounded-lg bg-slate-950/50 border border-slate-700/50 text-white text-sm px-3 py-2.5 focus:outline-none focus:ring-1 focus:ring-emerald-500/50 focus:border-emerald-500/50 transition-all placeholder-slate-600"
+ placeholder="5551234567"
+ autoFocus
+ />
-
{
- setPhoneNumber(e.target.value.replace(/[^0-9]/g, ""));
- setVerifyFeedback(null);
- }}
- onKeyDown={(e) => { if (e.key === "Enter" && phoneNumber.trim()) handleSendCode(); }}
- className="w-full rounded-lg bg-slate-950/50 border border-slate-700/50 text-white text-sm px-3 py-2.5 focus:outline-none focus:ring-1 focus:ring-emerald-500/50 focus:border-emerald-500/50 transition-all placeholder-slate-600"
- placeholder="1 555 123 4567"
- autoFocus
- />
-
Include your country code (e.g. 1 for US, 44 for UK)
@@ -340,41 +466,76 @@ export default function DashboardPage() {
- We'll send a 6-digit code to verify you own this number. The code expires in 5 minutes.
+ We'll register this phone to your account, then generate a code for you to send from WhatsApp. Code expires in 5 minutes.
>
) : (
-
-
-
{
- setVerifyCode(e.target.value.replace(/[^0-9]/g, ""));
- setVerifyFeedback(null);
- }}
- onKeyDown={(e) => { if (e.key === "Enter" && verifyCode.length === 6) handleVerifyCode(); }}
- className="w-full rounded-lg bg-slate-950/50 border border-slate-700/50 text-white text-sm px-3 py-2.5 focus:outline-none focus:ring-1 focus:ring-emerald-500/50 focus:border-emerald-500/50 transition-all placeholder-slate-600 font-mono text-center text-lg tracking-[0.5em]"
- placeholder="000000"
- autoFocus
- />
-
- Sent to +{phoneNumber}.{" "}
-
-
-
+
+ Click here to send this on WhatsApp
+
+ ) : (
+
+ WhatsApp number is not configured. Set NEXT_PUBLIC_LOGLIFE_WHATSAPP_NUMBER.
+
+ )}
+
+
+
+ Waiting for a WhatsApp message from{" "}
+ {fullPhoneDisplay}.
+
+
+
+ Wrong number?{" "}
+
+ Change number
+
+
+
+ {pollUntil && (
+
+ Code expires in{" "}
+ {formatCountdown(countdownSeconds)}.
+
+ )}
+
+ >
)}
- {verifyFeedback && (
+ {verifyFeedback && (verifyStep === "phone" || verifyFeedback.type === "error") && (
)}
-
- {verifyLoading ? (
-
-
- {verifyStep === "phone" ? "Sending..." : "Verifying..."}
-
- ) : verifyStep === "phone" ? (
- "Send verification code"
- ) : (
- "Verify and connect"
- )}
-
+ {verifyStep === "phone" && (
+
+ {verifyLoading ? (
+
+
+ Registering...
+
+ ) : "Register and get WhatsApp code"}
+
+ )}
diff --git a/website/app/hero/hero.tsx b/website/app/hero/hero.tsx
index 6dd916ab..58c5de94 100644
--- a/website/app/hero/hero.tsx
+++ b/website/app/hero/hero.tsx
@@ -1,7 +1,6 @@
"use client";
import React, { useState, useEffect, useRef } from "react";
import Link from "next/link";
-import { useWhatsAppWidget } from "../contexts/WhatsAppWidgetContext";
function useInView(threshold = 0.15) {
const ref = useRef