's'
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user