Initial import of weiyuan frontend
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright (C) 2025 QuantumNous
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Sparkles } from 'lucide-react';
|
||||
|
||||
/**
|
||||
* 登录/注册/企业登录页卡片顶部的「品牌 Logo + 标题 + 副标题」头部。
|
||||
*
|
||||
* 这一段(Logo 光环 + 白底圆角 + 右上角 Sparkles + h4 标题 + p 副标题)原本在
|
||||
* LoginForm / RegisterForm / OrgLogin 中重复了 5 份,抽到这里统一维护,避免日后样式漂移。
|
||||
*
|
||||
* - logoNode:自定义 Logo 节点(如企业 Avatar);不传则用 logo(src) 渲染平台 <img>。
|
||||
* - wrapperClassName / logoWrapperClassName:保留各页面原有的间距微调(mb-*)。
|
||||
* - Sparkles 统一用 motion-safe:animate-pulse,遵循 prefers-reduced-motion。
|
||||
*/
|
||||
const AuthCardHeader = ({
|
||||
title,
|
||||
subtitle,
|
||||
logo,
|
||||
logoNode,
|
||||
wrapperClassName = 'mb-5',
|
||||
logoWrapperClassName = 'mb-3',
|
||||
}) => (
|
||||
<div
|
||||
className={`flex flex-col items-center justify-center ${wrapperClassName}`}
|
||||
>
|
||||
<div className={`relative ${logoWrapperClassName}`}>
|
||||
{/* Logo 光环 */}
|
||||
<div className='absolute -inset-1.5 bg-gradient-to-r from-brand-from/30 to-brand-to/30 rounded-xl blur-md opacity-60' />
|
||||
<div className='relative p-2 bg-white dark:bg-neutral-800 rounded-xl shadow-md'>
|
||||
{logoNode || (
|
||||
<img
|
||||
src={logo}
|
||||
alt='Logo'
|
||||
className='h-10 w-10 rounded-lg object-cover'
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<Sparkles
|
||||
size={14}
|
||||
className='absolute -top-0.5 -right-0.5 text-amber-400 motion-safe:animate-pulse'
|
||||
/>
|
||||
</div>
|
||||
<h4 className='text-xl font-bold text-gray-800 dark:text-white tracking-tight mb-0.5'>
|
||||
{title}
|
||||
</h4>
|
||||
<p className='text-gray-500 dark:text-gray-400 text-xs'>{subtitle}</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
export default AuthCardHeader;
|
||||
Reference in New Issue
Block a user