feat: enable marketing site registration and launch-prompt preservation (T12)
This commit is contained in:
@@ -2354,7 +2354,7 @@ function Closing() {
|
||||
|
||||
<div className="closing-cta">
|
||||
<div className="row">
|
||||
<a href="Beta Signup.html" className="btn btn-primary">
|
||||
<a href="/auth?new=1" className="btn btn-primary">
|
||||
Request invite <Arrow />
|
||||
</a>
|
||||
<a href="#how" className="btn btn-ghost">
|
||||
@@ -2598,6 +2598,17 @@ function LaunchModal({ prompt, onClose }) {
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [onClose]);
|
||||
|
||||
// Preserve prompt for onboarding seeding (T12)
|
||||
useEffect(() => {
|
||||
if (typeof window !== "undefined" && prompt) {
|
||||
try {
|
||||
localStorage.setItem("vibn:firstName", prompt);
|
||||
} catch (err) {
|
||||
console.error("Failed to save hero prompt to localStorage:", err);
|
||||
}
|
||||
}
|
||||
}, [prompt]);
|
||||
|
||||
const [step, setStep] = useState(0);
|
||||
useEffect(() => {
|
||||
if (step >= 4) return undefined;
|
||||
@@ -2605,6 +2616,17 @@ function LaunchModal({ prompt, onClose }) {
|
||||
return () => clearTimeout(t);
|
||||
}, [step]);
|
||||
|
||||
const [redirectCount, setRedirectCount] = useState(3);
|
||||
useEffect(() => {
|
||||
if (step < 4) return undefined;
|
||||
if (redirectCount <= 0) {
|
||||
window.location.href = "/auth";
|
||||
return undefined;
|
||||
}
|
||||
const t = setTimeout(() => setRedirectCount(redirectCount - 1), 1000);
|
||||
return () => clearTimeout(t);
|
||||
}, [step, redirectCount]);
|
||||
|
||||
return (
|
||||
<div className="modal-backdrop" onClick={onClose}>
|
||||
<style>{`
|
||||
@@ -2693,9 +2715,50 @@ function LaunchModal({ prompt, onClose }) {
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="modal-foot">
|
||||
No homework · No setup · No new tools to learn
|
||||
</div>
|
||||
{step === 4 ? (
|
||||
<div
|
||||
className="modal-actions"
|
||||
style={{
|
||||
marginTop: "24px",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: "12px",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<a
|
||||
href="/auth"
|
||||
className="btn btn-primary"
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "48px",
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: "8px",
|
||||
fontSize: "15px",
|
||||
fontWeight: "600",
|
||||
textDecoration: "none",
|
||||
}}
|
||||
>
|
||||
Launch Your Workspace <Arrow size={14} />
|
||||
</a>
|
||||
<span
|
||||
style={{
|
||||
fontSize: "11px",
|
||||
color: "var(--fg-faint)",
|
||||
fontFamily: "var(--font-mono)",
|
||||
letterSpacing: "0.04em",
|
||||
}}
|
||||
>
|
||||
Redirecting to registration in {redirectCount}s...
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="modal-foot">
|
||||
No homework · No setup · No new tools to learn
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user