详情区分运动
This commit is contained in:
@@ -7,17 +7,41 @@ interface MatchTabsProps {
|
||||
activeTab: string;
|
||||
onTabChange: (tab: string) => void;
|
||||
isDark: boolean;
|
||||
sportId: number;
|
||||
}
|
||||
|
||||
export function MatchTabs({ activeTab, onTabChange, isDark }: MatchTabsProps) {
|
||||
export function MatchTabs({ activeTab, onTabChange, isDark, sportId }: MatchTabsProps) {
|
||||
const { t } = useTranslation();
|
||||
const containerBg = isDark ? "#121212" : "#F8F8F8";
|
||||
|
||||
const tabs = [
|
||||
{ id: "info", label: t("detail.tabs.info") },
|
||||
{ id: "h2h", label: t("detail.tabs.h2h") },
|
||||
{ id: "chat", label: t("detail.tabs.chat") },
|
||||
];
|
||||
// 根据 sportId 动态生成标签
|
||||
const getTabs = () => {
|
||||
if (sportId === 1) {
|
||||
// 足球: 详情、统计数据、赔率、交锋往绩、聊天
|
||||
return [
|
||||
{ id: "info", label: t("detail.tabs.info") },
|
||||
{ id: "stats", label: t("detail.tabs.stats") },
|
||||
{ id: "odds", label: t("detail.tabs.odds") },
|
||||
{ id: "h2h", label: t("detail.tabs.h2h") },
|
||||
{ id: "chat", label: t("detail.tabs.chat") },
|
||||
];
|
||||
} else if (sportId === 2) {
|
||||
// 篮球: 详情、交锋往绩、聊天
|
||||
return [
|
||||
{ id: "info", label: t("detail.tabs.info") },
|
||||
{ id: "h2h", label: t("detail.tabs.h2h") },
|
||||
{ id: "chat", label: t("detail.tabs.chat") },
|
||||
];
|
||||
}
|
||||
// 默认: 详情、交锋往绩、聊天
|
||||
return [
|
||||
{ id: "info", label: t("detail.tabs.info") },
|
||||
{ id: "h2h", label: t("detail.tabs.h2h") },
|
||||
{ id: "chat", label: t("detail.tabs.chat") },
|
||||
];
|
||||
};
|
||||
|
||||
const tabs = getTabs();
|
||||
|
||||
return (
|
||||
<View style={[styles.container, { backgroundColor: containerBg }]}>
|
||||
|
||||
Reference in New Issue
Block a user