Files
gitlab-instance-0a899031_no…/app/vip/components/landing/LoginBlock.tsx
2026-03-12 00:34:50 -05:00

30 lines
976 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import { useState, useEffect } from "react";
import styles from "../vip.module.css";
import { LoginForm } from "./LoginForm";
type LoginBlockProps = {
onVerify: (userId: string) => Promise<boolean>;
onSuccess: () => void;
};
export function LoginBlock({ onVerify, onSuccess }: LoginBlockProps) {
const [hash, setHash] = useState("");
useEffect(() => {
setHash(typeof window !== "undefined" ? window.location.hash : "");
}, []);
return (
<section id="login" className={styles.section} style={{ paddingTop: "2rem" }}>
<div className={styles.card} style={{ maxWidth: "400px", margin: "0 auto" }}>
<h2 className={styles.sectionTitle}></h2>
<p className={styles.sectionDesc}>
使 user_id
</p>
<LoginForm onVerify={onVerify} onSuccess={onSuccess} autoFocus={hash === "#login"} />
</div>
</section>
);
}