chore(energy): 重新放开电能 tab
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- 取消之前的临时屏蔽,恢复氢能/电能两个顶部 tab - 电能内部已和氢能同时支持 truck_id 区分外部/我司,外部空数据会展示「数据对接中…」 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,30 +1,39 @@
|
||||
import { Fuel } from 'lucide-react';
|
||||
import { useState } from 'react';
|
||||
import { Fuel, BatteryCharging } from 'lucide-react';
|
||||
import { motion } from 'motion/react';
|
||||
import HydrogenView from './HydrogenView';
|
||||
// 电能暂未发布,发版前临时隐藏入口(保留 ElectricView/ElectricOverview/ElectricDaily 代码)
|
||||
// import { useState } from 'react';
|
||||
// import { BatteryCharging } from 'lucide-react';
|
||||
// import ElectricView from './ElectricView';
|
||||
// type TopTab = 'hydrogen' | 'electric';
|
||||
import ElectricView from './ElectricView';
|
||||
|
||||
type TopTab = 'hydrogen' | 'electric';
|
||||
|
||||
export default function EnergyModule() {
|
||||
const [activeTab, setActiveTab] = useState<TopTab>('hydrogen');
|
||||
return (
|
||||
<div className="min-h-screen bg-[#F8F9FB] text-gray-800 font-sans p-3 md:p-6 relative" style={{ overflowX: 'clip' }}>
|
||||
<div className="max-w-6xl mx-auto flex flex-col gap-3 pb-16 landscape:pb-0 landscape:h-full landscape:flex-1 landscape:overflow-hidden">
|
||||
<div className="bg-white px-4 py-2 rounded-2xl border border-slate-100 shadow-sm flex items-center gap-6 sticky top-0 z-30">
|
||||
<div className="flex items-center gap-2 py-1 relative text-blue-600">
|
||||
<button
|
||||
onClick={() => setActiveTab('hydrogen')}
|
||||
className={`flex items-center gap-2 py-1 transition-all relative ${activeTab === 'hydrogen' ? 'text-blue-600' : 'text-slate-400'}`}
|
||||
>
|
||||
<Fuel size={14} />
|
||||
<span className="text-[11px] font-bold">氢能</span>
|
||||
<motion.div layoutId="activeEnergyTopTab" className="absolute -bottom-2 left-0 right-0 h-0.5 bg-blue-600 rounded-full" />
|
||||
</div>
|
||||
{/*
|
||||
<button onClick={() => setActiveTab('electric')} ...>
|
||||
{activeTab === 'hydrogen' && (
|
||||
<motion.div layoutId="activeEnergyTopTab" className="absolute -bottom-2 left-0 right-0 h-0.5 bg-blue-600 rounded-full" />
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setActiveTab('electric')}
|
||||
className={`flex items-center gap-2 py-1 transition-all relative ${activeTab === 'electric' ? 'text-blue-600' : 'text-slate-400'}`}
|
||||
>
|
||||
<BatteryCharging size={14} />
|
||||
<span className="text-[11px] font-bold">电能</span>
|
||||
{activeTab === 'electric' && (
|
||||
<motion.div layoutId="activeEnergyTopTab" className="absolute -bottom-2 left-0 right-0 h-0.5 bg-blue-600 rounded-full" />
|
||||
)}
|
||||
</button>
|
||||
*/}
|
||||
</div>
|
||||
<HydrogenView />
|
||||
{activeTab === 'hydrogen' ? <HydrogenView /> : <ElectricView />}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user