This commit is contained in:
eric
2026-03-12 19:52:34 -05:00
parent 4a223cd788
commit e5d080c202
18 changed files with 635 additions and 158 deletions

View File

@@ -1,9 +1,8 @@
"use client";
import { useEffect, useState } from "react";
import { useEffect } from "react";
import styles from "../vip.module.css";
import { LoginForm } from "./LoginForm";
import { AuthForm } from "./AuthForm";
type LoginModalProps = {
open: boolean;
@@ -14,8 +13,6 @@ type LoginModalProps = {
};
export function LoginModal({ open, onClose, onVerify, onVerifyByEmail, onSuccess }: LoginModalProps) {
const [tab, setTab] = useState<"email" | "legacy">("email");
useEffect(() => {
if (open) {
document.body.style.overflow = "hidden";
@@ -73,41 +70,12 @@ export function LoginModal({ open, onClose, onVerify, onVerifyByEmail, onSuccess
</svg>
</button>
</div>
<div className="mb-4 flex gap-2 border-b border-[var(--border)]">
<button
type="button"
onClick={() => setTab("email")}
className={`pb-2 text-sm font-medium ${tab === "email" ? "border-b-2 border-[var(--primary)] text-[var(--primary)]" : "text-[var(--muted-foreground)]"}`}
>
</button>
<button
type="button"
onClick={() => setTab("legacy")}
className={`pb-2 text-sm font-medium ${tab === "legacy" ? "border-b-2 border-[var(--primary)] text-[var(--primary)]" : "text-[var(--muted-foreground)]"}`}
>
</button>
</div>
{tab === "email" ? (
<p className={styles.sectionDesc} style={{ marginBottom: "1rem" }}>
使 digital / meetup
</p>
) : (
<p className={styles.sectionDesc} style={{ marginBottom: "1rem" }}>
user_id users
</p>
)}
{tab === "email" ? (
<AuthForm onSuccess={handleSuccess} autoFocus />
) : (
<LoginForm
onVerify={onVerify}
onVerifyByEmail={onVerifyByEmail}
onSuccess={handleSuccess}
autoFocus
/>
)}
<LoginForm
onVerify={onVerify}
onVerifyByEmail={onVerifyByEmail}
onSuccess={handleSuccess}
autoFocus
/>
</div>
</div>
);