|
|
|
@ -51,8 +51,10 @@ export function SideMenu({ width, lastTactics, teams } : { width : number, lastT
|
|
|
|
|
<div id="sideMenu" style={{
|
|
|
|
|
width : width + "%",
|
|
|
|
|
}}>
|
|
|
|
|
<Team teams={teams}/>
|
|
|
|
|
<Tactic lastTactics={lastTactics}/>
|
|
|
|
|
<div id="sideMenuContent">
|
|
|
|
|
<Team teams={teams}/>
|
|
|
|
|
<Tactic lastTactics={lastTactics}/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
@ -151,24 +153,36 @@ export function Team({teams} : {teams : Team[]}) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function Tactic({lastTactics} : { lastTactics : Tactic[]}) {
|
|
|
|
|
|
|
|
|
|
const listTactic = lastTactics.map(tactic =>
|
|
|
|
|
<li
|
|
|
|
|
key = {tactic.id}
|
|
|
|
|
>
|
|
|
|
|
{tactic.name} : {tactic.creation_date}
|
|
|
|
|
<button onClick={() => {location.pathname="/tactic/"+tactic.id+"/edit"}}>open</button>
|
|
|
|
|
</li>
|
|
|
|
|
);
|
|
|
|
|
return (
|
|
|
|
|
<div id="tactic">
|
|
|
|
|
<div className="titreSideMenu">
|
|
|
|
|
<h2 className="title">Mes dernières stratégies</h2>
|
|
|
|
|
<button className="new" id="createTactic" onClick={() => (location.pathname = "/tactic/new")}>+</button>
|
|
|
|
|
</div>
|
|
|
|
|
<ul>
|
|
|
|
|
{listTactic}
|
|
|
|
|
</ul>
|
|
|
|
|
<SetButtonTactic tactics={lastTactics}/>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function SetButtonTactic ({tactics} : {tactics : Tactic[]}) {
|
|
|
|
|
const lastTactics = tactics.map(tactic =>
|
|
|
|
|
<ButtonLastTactic tactic={tactic} />
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<div id="SetButtonTactic">
|
|
|
|
|
{lastTactics}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
function ButtonLastTactic ({tactic} : {tactic : Tactic}) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
id={"Button"+tactic.id}
|
|
|
|
|
className="ButtonLastTactic"
|
|
|
|
|
onClick={() => {location.pathname="/tactic/"+tactic.id+"/edit"}}
|
|
|
|
|
>
|
|
|
|
|
{tactic.name}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|