feat: 将 StockQuoteCard 提升到 Tab 容器上方 + 修复 TS 警告
功能变更: - 将 StockQuoteCard 从 CompanyOverview 移至 Company/index.tsx - 股票行情卡片现在在切换 Tab 时始终可见 TypeScript 警告修复: - SubTabContainer: WebkitBackdropFilter 改用 sx 属性 - DetailTable: 重新定义 TableRowData 类型,支持 boolean 索引 - SubscriptionContentNew: 添加类型安全的 AGREEMENT_URLS 索引访问 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import SubTabContainer from '@components/SubTabContainer';
|
||||
import { useCompanyEvents } from './hooks/useCompanyEvents';
|
||||
import { useCompanyData } from './hooks/useCompanyData';
|
||||
import CompanyHeader from './components/CompanyHeader';
|
||||
import StockQuoteCard from './components/StockQuoteCard';
|
||||
import { THEME, TAB_CONFIG } from './config';
|
||||
|
||||
// ============================================
|
||||
@@ -39,11 +40,31 @@ TabLoadingFallback.displayName = 'TabLoadingFallback';
|
||||
|
||||
interface CompanyContentProps {
|
||||
stockCode: string;
|
||||
isInWatchlist: boolean;
|
||||
watchlistLoading: boolean;
|
||||
onWatchlistToggle: () => void;
|
||||
onTabChange: (index: number, tabKey: string) => void;
|
||||
}
|
||||
|
||||
const CompanyContent = memo<CompanyContentProps>(({ stockCode, onTabChange }) => (
|
||||
const CompanyContent = memo<CompanyContentProps>(({
|
||||
stockCode,
|
||||
isInWatchlist,
|
||||
watchlistLoading,
|
||||
onWatchlistToggle,
|
||||
onTabChange,
|
||||
}) => (
|
||||
<Box maxW="container.xl" mx="auto" px={4} py={6}>
|
||||
{/* 股票行情卡片 - 放在 Tab 切换器上方,始终可见 */}
|
||||
<Box mb={6}>
|
||||
<StockQuoteCard
|
||||
stockCode={stockCode}
|
||||
isInWatchlist={isInWatchlist}
|
||||
isWatchlistLoading={watchlistLoading}
|
||||
onWatchlistToggle={onWatchlistToggle}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
{/* Tab 内容区 */}
|
||||
<Box
|
||||
position="relative"
|
||||
bg={`linear-gradient(145deg, rgba(26, 26, 46, 0.95) 0%, rgba(15, 15, 26, 0.98) 100%)`}
|
||||
@@ -245,6 +266,9 @@ const CompanyIndex: React.FC = () => {
|
||||
<Box position="relative" zIndex={1}>
|
||||
<CompanyContent
|
||||
stockCode={stockCode}
|
||||
isInWatchlist={isInWatchlist}
|
||||
watchlistLoading={watchlistLoading}
|
||||
onWatchlistToggle={handleWatchlistToggle}
|
||||
onTabChange={handleTabChange}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user