|
|
@ -99,7 +99,7 @@ function BodyPersonalSpace({ allTactics } : { allTactics : Tactic[]}) {
|
|
|
|
i = 0;
|
|
|
|
i = 0;
|
|
|
|
while (i < nbRow) {
|
|
|
|
while (i < nbRow) {
|
|
|
|
listTactic[i] = listTactic[i].map((tactic : Tactic) =>
|
|
|
|
listTactic[i] = listTactic[i].map((tactic : Tactic) =>
|
|
|
|
<td key={tactic.id} className="dataTactic" onClick={() => {location.pathname="/tactic/"+tactic.id+"/edit"}}>{tactic.name}</td>
|
|
|
|
<td key={tactic.id} className="dataTactic" onClick={() => {location.pathname="/tactic/"+tactic.id+"/edit"}}>{troncName(tactic.name, 25)}</td>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -145,9 +145,7 @@ export function Team({teams} : {teams : Team[]}) {
|
|
|
|
<h2 className="title">Mes équipes</h2>
|
|
|
|
<h2 className="title">Mes équipes</h2>
|
|
|
|
<button className="new" onClick={() => location.pathname="/team/new"}>+</button>
|
|
|
|
<button className="new" onClick={() => location.pathname="/team/new"}>+</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<ul>
|
|
|
|
<SetButtonTeam teams={teams}/>
|
|
|
|
{listTeam}
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -170,19 +168,56 @@ function SetButtonTactic ({tactics} : {tactics : Tactic[]}) {
|
|
|
|
<ButtonLastTactic tactic={tactic} />
|
|
|
|
<ButtonLastTactic tactic={tactic} />
|
|
|
|
);
|
|
|
|
);
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div id="SetButtonTactic">
|
|
|
|
<div className="SetButton">
|
|
|
|
{lastTactics}
|
|
|
|
{lastTactics}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function SetButtonTeam({teams} : {teams : Team[]}) {
|
|
|
|
|
|
|
|
const listTeam = teams.map(teams =>
|
|
|
|
|
|
|
|
<ButtonTeam team={teams} />
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<div className="SetButton">
|
|
|
|
|
|
|
|
{listTeam}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ButtonTeam ({team} : {team : Team}) {
|
|
|
|
|
|
|
|
const name = troncName(team.name, 20);
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
id={"ButtonTeam"+team.id}
|
|
|
|
|
|
|
|
className="ButtonSideMenu"
|
|
|
|
|
|
|
|
onClick={() => {location.pathname="/team/"+team.id}}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{name}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function ButtonLastTactic ({tactic} : {tactic : Tactic}) {
|
|
|
|
function ButtonLastTactic ({tactic} : {tactic : Tactic}) {
|
|
|
|
|
|
|
|
const name = troncName(tactic.name, 20);
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
id={"Button"+tactic.id}
|
|
|
|
id={"Button"+tactic.id}
|
|
|
|
className="ButtonLastTactic"
|
|
|
|
className="ButtonSideMenu"
|
|
|
|
onClick={() => {location.pathname="/tactic/"+tactic.id+"/edit"}}
|
|
|
|
onClick={() => {location.pathname="/tactic/"+tactic.id+"/edit"}}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{tactic.name}
|
|
|
|
{name}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function troncName(name: string, limit: number) : string {
|
|
|
|
|
|
|
|
if (name.length > limit) {
|
|
|
|
|
|
|
|
name = name.substring(0, limit) + "...";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
name = name;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return name;
|
|
|
|
|
|
|
|
}
|