fix(ui): 统一认证页输入框 36px 与视觉样式
This commit is contained in:
@@ -71,6 +71,7 @@ import { Shield, Smartphone, QrCode } from 'lucide-react';
|
||||
import GlassCard from './GlassCard';
|
||||
import AuthCardHeader from './AuthCardHeader';
|
||||
import AuthLoginTabs from './AuthLoginTabs';
|
||||
import AuthDivider from './AuthDivider';
|
||||
import AgreementModal from '../common/DocumentRenderer/AgreementModal';
|
||||
import {
|
||||
isMiniProgramWebView,
|
||||
@@ -93,38 +94,26 @@ const IS_MOBILE_DEVICE =
|
||||
);
|
||||
|
||||
// 提取OAuthButton到组件外部,避免每次渲染都重建
|
||||
// 第三方登录按钮:统一为 36px 描边按钮,无位移 / 扫光动效(尺寸见 prototype.css .auth-login-page)
|
||||
const OAuthButton = React.memo(
|
||||
({ icon, children, onClick, loading, disabled, iconColor, t }) => (
|
||||
<button
|
||||
({ icon, children, onClick, loading, disabled, iconColor }) => (
|
||||
<Button
|
||||
block
|
||||
className='auth-oauth-button'
|
||||
onClick={onClick}
|
||||
disabled={loading || disabled}
|
||||
className={`
|
||||
group relative w-full h-10 flex items-center justify-center gap-2
|
||||
bg-white/80 dark:bg-white/[0.08] backdrop-blur-sm
|
||||
border border-gray-200/80 dark:border-white/[0.12]
|
||||
rounded-xl shadow-sm
|
||||
hover:bg-white dark:hover:bg-white/[0.12]
|
||||
hover:shadow-md hover:shadow-gray-200/50 dark:hover:shadow-black/30
|
||||
hover:-translate-y-0.5 hover:border-gray-300 dark:hover:border-white/20
|
||||
active:translate-y-0
|
||||
transition-all duration-200 ease-out
|
||||
disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:translate-y-0
|
||||
overflow-hidden
|
||||
`}
|
||||
loading={loading}
|
||||
disabled={disabled}
|
||||
icon={
|
||||
<span
|
||||
className='auth-oauth-icon'
|
||||
style={iconColor ? { color: iconColor } : undefined}
|
||||
>
|
||||
{icon}
|
||||
</span>
|
||||
}
|
||||
>
|
||||
{/* 悬停光效 */}
|
||||
<div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/30 dark:via-white/10 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' />
|
||||
|
||||
<span
|
||||
style={iconColor ? { color: iconColor } : undefined}
|
||||
className='relative z-10 flex items-center justify-center w-4 h-4 text-gray-700 dark:text-gray-200'
|
||||
>
|
||||
{icon}
|
||||
</span>
|
||||
<span className='relative z-10 font-medium text-sm text-gray-700 dark:text-gray-200'>
|
||||
{loading ? (t ? t('加载中...') : '加载中...') : children}
|
||||
</span>
|
||||
</button>
|
||||
{children}
|
||||
</Button>
|
||||
),
|
||||
);
|
||||
|
||||
@@ -629,7 +618,7 @@ const LoginForm = () => {
|
||||
subtitle={t('请选择登录方式')}
|
||||
/>
|
||||
|
||||
<div className='space-y-2'>
|
||||
<div className='auth-option-list'>
|
||||
{status.wechat_login && (
|
||||
<OAuthButton
|
||||
icon={<Icon svg={<WeChatIcon />} />}
|
||||
@@ -730,39 +719,22 @@ const LoginForm = () => {
|
||||
</OAuthButton>
|
||||
)}
|
||||
|
||||
{/* 分隔线 */}
|
||||
<div className='relative py-3'>
|
||||
<div className='absolute inset-0 flex items-center'>
|
||||
<div className='w-full border-t border-gray-200/80 dark:border-white/[0.08]'></div>
|
||||
</div>
|
||||
<div className='relative flex justify-center'>
|
||||
<span className='px-3 text-xs text-gray-400 dark:text-gray-500 bg-white/60 dark:bg-neutral-900/70 backdrop-blur-md rounded-full'>
|
||||
{t('或')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<AuthDivider>{t('或')}</AuthDivider>
|
||||
|
||||
{/* 邮箱登录按钮 */}
|
||||
<button
|
||||
<Button
|
||||
theme='solid'
|
||||
block
|
||||
className='auth-login-submit'
|
||||
icon={<IconMail />}
|
||||
onClick={handleEmailLoginClick}
|
||||
className='app-action-button group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 overflow-hidden'
|
||||
>
|
||||
{/* 闪光效果 */}
|
||||
<div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' />
|
||||
|
||||
<IconMail className='relative z-10' />
|
||||
<span className='relative z-10 font-medium text-sm'>
|
||||
{t('邮箱/用户名 登录')}
|
||||
</span>
|
||||
<ActionArrowRight
|
||||
size={16}
|
||||
className='relative z-10 group-hover:translate-x-1 transition-transform'
|
||||
/>
|
||||
</button>
|
||||
{t('邮箱/用户名 登录')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{(hasUserAgreement || hasPrivacyPolicy) && (
|
||||
<div className='mt-4 flex justify-center'>
|
||||
<div className='auth-login-agreement flex justify-center'>
|
||||
<Checkbox
|
||||
checked={agreedToTerms}
|
||||
onChange={(e) => setAgreedToTerms(e.target.checked)}
|
||||
@@ -801,7 +773,7 @@ const LoginForm = () => {
|
||||
)}
|
||||
|
||||
{!status.self_use_mode_enabled && (
|
||||
<div className='mt-4 text-center'>
|
||||
<div className='auth-login-register text-center'>
|
||||
<Text className='text-gray-500 dark:text-gray-400 text-xs'>
|
||||
{t('没有账户?')}{' '}
|
||||
<Link
|
||||
@@ -815,7 +787,7 @@ const LoginForm = () => {
|
||||
)}
|
||||
|
||||
{/* 安全提示 */}
|
||||
<div className='mt-4 flex items-center justify-center gap-1.5 text-[10px] text-gray-400 dark:text-gray-500'>
|
||||
<div className='auth-login-security'>
|
||||
<Shield size={12} />
|
||||
<span>{t('安全登录')}</span>
|
||||
</div>
|
||||
@@ -847,16 +819,7 @@ const LoginForm = () => {
|
||||
)}
|
||||
|
||||
{status.passkey_login && passkeySupported && (
|
||||
<div className='relative py-2'>
|
||||
<div className='absolute inset-0 flex items-center'>
|
||||
<div className='w-full border-t border-gray-200/80 dark:border-white/[0.08]'></div>
|
||||
</div>
|
||||
<div className='relative flex justify-center'>
|
||||
<span className='px-3 text-xs text-gray-400 dark:text-gray-500 bg-white/60 dark:bg-neutral-900/70 backdrop-blur-md rounded-full'>
|
||||
{t('或')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<AuthDivider>{t('或')}</AuthDivider>
|
||||
)}
|
||||
|
||||
<Form className='auth-login-form' onSubmit={handleSubmit}>
|
||||
@@ -972,24 +935,15 @@ const LoginForm = () => {
|
||||
status.wechat_open_oauth ||
|
||||
status.linuxdo_oauth ||
|
||||
status.telegram_oauth) && (
|
||||
<div className='mt-1'>
|
||||
<div className='relative py-2'>
|
||||
<div className='absolute inset-0 flex items-center'>
|
||||
<div className='w-full border-t border-gray-200/80 dark:border-white/[0.08]'></div>
|
||||
</div>
|
||||
<div className='relative flex justify-center'>
|
||||
<span className='px-3 text-xs text-gray-400 dark:text-gray-500 bg-white/60 dark:bg-neutral-900/70 backdrop-blur-md rounded-full'>
|
||||
{t('或')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
<div>
|
||||
<AuthDivider>{t('或')}</AuthDivider>
|
||||
<Button
|
||||
block
|
||||
className='auth-oauth-button'
|
||||
onClick={handleOtherLoginOptionsClick}
|
||||
className='w-full h-9 flex items-center justify-center gap-2 text-sm text-gray-600 dark:text-gray-300 border border-gray-200/80 dark:border-white/[0.12] rounded-lg hover:bg-gray-50 dark:hover:bg-white/[0.06] hover:border-gray-300 dark:hover:border-white/20 transition-all'
|
||||
>
|
||||
{t('其他登录选项')}
|
||||
</button>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -1008,7 +962,7 @@ const LoginForm = () => {
|
||||
)}
|
||||
|
||||
{/* 安全提示 */}
|
||||
<div className='mt-3 flex items-center justify-center gap-1.5 text-[10px] text-gray-400 dark:text-gray-500'>
|
||||
<div className='auth-login-security'>
|
||||
<Shield size={12} />
|
||||
<span>{t('安全登录')}</span>
|
||||
</div>
|
||||
@@ -1040,7 +994,7 @@ const LoginForm = () => {
|
||||
okButtonProps={{
|
||||
loading: wechatCodeSubmitLoading,
|
||||
}}
|
||||
className='wechat-login-modal'
|
||||
className='wechat-login-modal auth-login-modal'
|
||||
>
|
||||
{/* 移动端提示 */}
|
||||
{isMobileView && !isInWeChat && (
|
||||
@@ -1103,7 +1057,6 @@ const LoginForm = () => {
|
||||
onChange={(value) =>
|
||||
handleChange('wechat_verification_code', value)
|
||||
}
|
||||
className='!rounded-xl'
|
||||
/>
|
||||
</Form>
|
||||
</Modal>
|
||||
@@ -1192,11 +1145,11 @@ const LoginForm = () => {
|
||||
<Modal
|
||||
title={
|
||||
<div className='flex items-center gap-3'>
|
||||
<div className='w-10 h-10 rounded-xl bg-gradient-to-br from-green-400 to-emerald-500 flex items-center justify-center shadow-lg shadow-green-500/30'>
|
||||
<Shield size={20} className='text-white' />
|
||||
<div className='auth-modal-title-icon'>
|
||||
<Shield size={18} />
|
||||
</div>
|
||||
<div>
|
||||
<div className='font-bold'>{t('两步验证')}</div>
|
||||
<div className='font-semibold'>{t('两步验证')}</div>
|
||||
<div className='text-xs text-gray-500 dark:text-gray-400 font-normal'>
|
||||
{t('请输入验证码完成登录')}
|
||||
</div>
|
||||
@@ -1208,6 +1161,7 @@ const LoginForm = () => {
|
||||
footer={null}
|
||||
width={450}
|
||||
centered
|
||||
className='auth-login-modal'
|
||||
>
|
||||
<TwoFAVerification
|
||||
onSuccess={handle2FASuccess}
|
||||
|
||||
Reference in New Issue
Block a user