fix: evolution tree tabs — one branch at a time instead of 3 cramped columns
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 18s

This commit is contained in:
2026-03-28 18:52:14 +01:00
parent a665fdf2f4
commit 3de0492631

View File

@@ -1,6 +1,7 @@
// EvolutionTree.tsx — Arbre d'Évolution V2 (Sprint 3)
// 3 branches + capstones + post-capstone repeatables + Convergence évolutif
import { useState } from "react";
import { useGameStore } from "../store/useGameStore";
import {
canBuyEvolutionNode,
@@ -208,10 +209,13 @@ function ConvergenceSection() {
);
}
const BRANCHES: Branch[] = ["ponte", "marais", "adaptation"];
export function EvolutionTree() {
const state = useGameStore((s) => s.state);
const resetTree = useGameStore((s) => s.resetTree);
const { prestigeCount, ancestralDna, evolutionTree } = state;
const [activeBranch, setActiveBranch] = useState<Branch>("ponte");
if (prestigeCount < 1) return null;
@@ -254,11 +258,31 @@ export function EvolutionTree() {
)}
</div>
</div>
<div className="flex gap-1.5">
<BranchColumn branch="ponte" />
<BranchColumn branch="marais" />
<BranchColumn branch="adaptation" />
{/* Branch tabs */}
<div className="flex gap-1">
{BRANCHES.map((branch) => {
const config = BRANCH_CONFIG[branch];
const isActive = activeBranch === branch;
return (
<button
key={branch}
onClick={() => setActiveBranch(branch)}
className={`gp-btn flex-1 py-1.5! text-[0.7rem]! font-bold! uppercase! tracking-wider! ${
isActive
? `gp-btn--buy ${config.accent}`
: "gp-btn--disabled"
}`}
>
{config.label}
</button>
);
})}
</div>
{/* Active branch content */}
<BranchColumn branch={activeBranch} />
<ConvergenceSection />
</div>
);