From 96ee1a7f5c7f31622d711aa0da00394e952cb72a Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 18 Dec 2025 18:29:42 +0800 Subject: [PATCH] =?UTF-8?q?refactor(theme):=20=E7=BB=9F=E4=B8=80=E9=BB=91?= =?UTF-8?q?=E9=87=91=E4=B8=BB=E9=A2=98=E5=B8=B8=E9=87=8F=EF=BC=8C=E5=87=8F?= =?UTF-8?q?=E5=B0=91=E7=A1=AC=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - theme/index.ts: 添加 COLORS, GLOW, GLASS 便捷常量 - theme/index.ts: 导出 glassCardStyle 可复用样式 - BusinessInfoPanel: 迁移到使用统一主题常量 迁移指南: - import { COLORS, GLASS, glassCardStyle } from '@views/Company/theme' - 替换 rgba(212, 175, 55, x) → COLORS.border / COLORS.borderHover - 替换硬编码背景 → GLASS.bgDark / COLORS.bgGlass 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../components/BusinessInfoPanel.tsx | 49 ++++------- src/views/Company/theme/index.ts | 88 ++++++++++++++++++- 2 files changed, 105 insertions(+), 32 deletions(-) diff --git a/src/views/Company/components/CompanyOverview/BasicInfoTab/components/BusinessInfoPanel.tsx b/src/views/Company/components/CompanyOverview/BasicInfoTab/components/BusinessInfoPanel.tsx index bc8b99d3..8e4a1b1f 100644 --- a/src/views/Company/components/CompanyOverview/BasicInfoTab/components/BusinessInfoPanel.tsx +++ b/src/views/Company/components/CompanyOverview/BasicInfoTab/components/BusinessInfoPanel.tsx @@ -23,6 +23,8 @@ import { FaFileAlt, } from "react-icons/fa"; +// 使用统一主题 +import { COLORS, GLASS, glassCardStyle } from "@views/Company/theme"; import { THEME } from "../config"; import { useBasicInfo } from "../../hooks/useBasicInfo"; @@ -30,38 +32,23 @@ interface BusinessInfoPanelProps { stockCode: string; } -// 玻璃态卡片样式 -const glassCardStyle = { - bg: "rgba(15, 18, 35, 0.6)", - borderRadius: "12px", - border: "1px solid rgba(212, 175, 55, 0.2)", - backdropFilter: "blur(8px)", - position: "relative" as const, - overflow: "hidden", - transition: "all 0.2s ease", - _hover: { - borderColor: "rgba(212, 175, 55, 0.4)", - bg: "rgba(15, 18, 35, 0.7)", - }, -}; - // 区块标题组件 const SectionTitle: React.FC<{ icon: React.ElementType; title: string }> = ({ icon, title, }) => ( - + {title} - + ); @@ -80,12 +67,12 @@ const InfoRow: React.FC<{ py={2} px={3} borderRadius="8px" - bg="rgba(0, 0, 0, 0.2)" - _hover={{ bg: "rgba(212, 175, 55, 0.05)" }} + bg={GLASS.bgDark} + _hover={{ bg: GLASS.bgGold }} transition="all 0.15s ease" > - {icon && } - + {icon && } + {label} {isCode ? ( @@ -93,7 +80,7 @@ const InfoRow: React.FC<{ fontSize="12px" fontFamily="mono" bg="rgba(212, 175, 55, 0.15)" - color={THEME.goldLight} + color={COLORS.goldLight} px={2} py={0.5} borderRadius="4px" @@ -104,7 +91,7 @@ const InfoRow: React.FC<{ ) : ( - - + + {label} - + {value || "-"} @@ -152,7 +139,7 @@ const TextSection: React.FC<{