Files
2026-03-11 23:47:45 -05:00

63 lines
1.6 KiB
TypeScript
Raw Permalink 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 Link from "next/link";
import styles from "../vip.module.css";
type WelcomeBlockProps = {
userName: string | null;
};
function getStorage(key: string): string | null {
if (typeof window === "undefined") return null;
return localStorage.getItem(key);
}
export function WelcomeBlock({ userName }: WelcomeBlockProps) {
const displayName = userName || getStorage("userName") || "会员";
return (
<section className={styles.section} style={{ paddingTop: "1.5rem" }}>
<h1
className="animate__animated animate__fadeInDown"
style={{
fontSize: "clamp(1.5rem, 4vw, 2rem)",
fontWeight: 600,
margin: 0,
animationDelay: "0.1s",
animationFillMode: "both",
}}
>
{displayName}
</h1>
<p
className="animate__animated animate__fadeInDown"
style={{
fontSize: "0.95rem",
color: "var(--muted-foreground)",
margin: "0.25rem 0 0",
animationDelay: "0.15s",
animationFillMode: "both",
}}
>
</p>
<Link
href="https://qun.hackrobot.cn"
target="_blank"
rel="noopener noreferrer"
className={styles.card}
style={{
display: "inline-flex",
alignItems: "center",
gap: "0.5rem",
marginTop: "1rem",
textDecoration: "none",
color: "var(--accent)",
fontWeight: 500,
}}
>
🌐 qun.hackrobot.cn
</Link>
</section>
);
}