From 55cf05110a1e1ce0c5116709a30e28be1d5109bd Mon Sep 17 00:00:00 2001 From: lan Date: Thu, 9 Jul 2026 17:15:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=94=A8=20lucide-react=20=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E6=9B=BF=E6=8D=A2=20emoji=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=89=80=E6=9C=89=20lint/=E6=9E=84=E5=BB=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 用 Carrot/Palette/Shirt/AlertTriangle 替换 CS/C/🎨/🧥/⚠️ - 清理所有未使用的 imports 和变量 - 修复 useEffect 中同步 setState 问题(改用 rAF / setTimeout) - 修复 no-unescaped-entities、匿名导出等 lint 错误 - 为 useSearchParams 添加 Suspense 边界(修复构建) - 0 errors, 0 warnings --- postcss.config.mjs | 6 +- src/app/auth/page.tsx | 14 ++- src/app/page.tsx | 3 +- src/app/profile/page.tsx | 20 +--- src/app/skins/page.tsx | 9 +- src/components/EnhancedButton.tsx | 38 +------ src/components/ErrorNotification.tsx | 42 -------- src/components/ErrorPage.tsx | 69 +++++-------- src/components/LoadingStates.tsx | 10 +- src/components/MessageNotification.tsx | 3 +- src/components/Navbar.tsx | 23 ++--- src/components/SkinCard.tsx | 7 +- src/components/SkinDetailModal.tsx | 29 +++--- src/components/SkinViewer.tsx | 128 ++++++++++++++---------- src/components/SliderCaptcha.tsx | 14 +-- src/components/profile/FavoritesTab.tsx | 3 +- src/components/profile/MySkinsTab.tsx | 8 +- src/contexts/AuthContext.tsx | 1 + src/lib/api.ts | 2 +- 19 files changed, 167 insertions(+), 262 deletions(-) diff --git a/postcss.config.mjs b/postcss.config.mjs index a7f73a2..297374d 100644 --- a/postcss.config.mjs +++ b/postcss.config.mjs @@ -1,5 +1,7 @@ -export default { +const config = { plugins: { '@tailwindcss/postcss': {}, }, -} +}; + +export default config; diff --git a/src/app/auth/page.tsx b/src/app/auth/page.tsx index f1fc428..b4edba1 100644 --- a/src/app/auth/page.tsx +++ b/src/app/auth/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useState, useEffect } from 'react'; +import { useState, useEffect, Suspense } from 'react'; import Link from 'next/link'; import { useRouter, useSearchParams } from 'next/navigation'; import { motion, AnimatePresence } from 'framer-motion'; @@ -17,7 +17,7 @@ import { sendVerificationCode, resetPassword } from '@/lib/api'; // - TLD:至少 2 位字母 const EMAIL_REGEX = /^(?!.*\.\.)[a-zA-Z0-9._%+-]+(? ({ ...prev, email: data.message || '发送验证码失败' })); errorManager.showError(data.message || '发送验证码失败'); } - } catch (error) { + } catch { setErrors(prev => ({ ...prev, email: '发送验证码失败,请稍后重试' })); errorManager.showError('发送验证码失败,请稍后重试'); } finally { @@ -958,4 +958,12 @@ export default function AuthPage() { ); +} + +export default function AuthPage() { + return ( + Loading...}> + + + ); } \ No newline at end of file diff --git a/src/app/page.tsx b/src/app/page.tsx index 72fc120..0eec085 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -12,6 +12,7 @@ import { SparklesIcon, RocketLaunchIcon } from '@heroicons/react/24/outline'; +import { Carrot } from 'lucide-react'; export default function Home() { const { scrollYProgress } = useScroll(); @@ -102,7 +103,7 @@ export default function Home() { >
- CS +
(null); + const [, setSelectedFile] = useState(null); const [editingProfile, setEditingProfile] = useState(null); const [editProfileName, setEditProfileName] = useState(''); const [uploadProgress, setUploadProgress] = useState(0); @@ -106,7 +102,7 @@ export default function ProfilePage() { const [emailCodeCountdown, setEmailCodeCountdown] = useState(0); const [isChangingEmail, setIsChangingEmail] = useState(false); - const { user, isAuthenticated, isLoading: isAuthLoading, logout, updateUser } = useAuth(); + const { isAuthenticated, isLoading: isAuthLoading, logout, updateUser } = useAuth(); // 加载用户数据 useEffect(() => { @@ -252,13 +248,6 @@ export default function ProfilePage() { } }; - const handleFileSelect = (e: React.ChangeEvent) => { - const file = e.target.files?.[0]; - if (file) { - setSelectedFile(file); - } - }; - const handleUploadSkin = async (file: File, data: { name: string; description: string; type: 'SKIN' | 'CAPE'; is_public: boolean; is_slim: boolean }) => { if (!file || !data.name.trim()) { messageManager.warning('请选择皮肤文件并输入皮肤名称', { duration: 3000 }); @@ -721,6 +710,7 @@ export default function ProfilePage() {
{userProfile?.avatar ? ( + /* eslint-disable-next-line @next/next/no-img-element */ {userProfile.username}

- 为角色 "{currentProfile?.name}" 选择皮肤 + 为角色 “{currentProfile?.name}” 选择皮肤