diff --git a/front/style/home.css b/front/style/home.css index 642c9c3..9188257 100644 --- a/front/style/home.css +++ b/front/style/home.css @@ -115,7 +115,7 @@ ul { border : pink solid 1px; } -#SetButtonTactic { +.SetButton { border: 0px solid brown; width: 80%; margin-left : 5%; @@ -123,7 +123,7 @@ ul { } -.ButtonLastTactic { +.ButtonSideMenu { border : black solid 1px; border-radius :0.5cap; width :fit-content; @@ -132,7 +132,7 @@ ul { overflow: hidden; } -.ButtonLastTactic:hover { +.ButtonSideMenu:hover { background-color: red; cursor : pointer; } diff --git a/front/views/Home.tsx b/front/views/Home.tsx index ff33df6..07f44a8 100644 --- a/front/views/Home.tsx +++ b/front/views/Home.tsx @@ -99,7 +99,7 @@ function BodyPersonalSpace({ allTactics } : { allTactics : Tactic[]}) { i = 0; while (i < nbRow) { listTactic[i] = listTactic[i].map((tactic : Tactic) => - {location.pathname="/tactic/"+tactic.id+"/edit"}}>{tactic.name} + {location.pathname="/tactic/"+tactic.id+"/edit"}}>{troncName(tactic.name, 25)} ); i++; } @@ -145,9 +145,7 @@ export function Team({teams} : {teams : Team[]}) {

Mes équipes

- + ) } @@ -170,19 +168,56 @@ function SetButtonTactic ({tactics} : {tactics : Tactic[]}) { ); return ( -
+
{lastTactics}
); } + +function SetButtonTeam({teams} : {teams : Team[]}) { + const listTeam = teams.map(teams => + + ); + return ( +
+ {listTeam} +
+ ); +} + +function ButtonTeam ({team} : {team : Team}) { + const name = troncName(team.name, 20); + return ( +
+
{location.pathname="/team/"+team.id}} + > + {name} +
+
+ ) +} + function ButtonLastTactic ({tactic} : {tactic : Tactic}) { + const name = troncName(tactic.name, 20); return (
{location.pathname="/tactic/"+tactic.id+"/edit"}} > - {tactic.name} + {name}
); } + +function troncName(name: string, limit: number) : string { + if (name.length > limit) { + name = name.substring(0, limit) + "..."; + } else { + name = name; + } + return name; +} \ No newline at end of file