diff --git a/front/style/home.css b/front/style/home.css
index c053198..56fcb8f 100644
--- a/front/style/home.css
+++ b/front/style/home.css
@@ -5,7 +5,8 @@
border : solid 2px purple;
display: flex;
flex-direction: column;
- font-family: Helvetica,;
+ font-family: Helvetica;
+ height: 100%;
}
.new {
@@ -22,7 +23,8 @@
display: flex;
flex-direction: row;
border : solid 10px violet;
- margin:0px
+ margin:0px;
+ height: 100%;
}
#personal-space {
@@ -52,7 +54,7 @@
}
#sideMenu .title {
- font-size: 13px;
+ font-size: 12px;
font-weight: bold;
color : #FFFFFF;
letter-spacing: 1px;
diff --git a/front/views/Home.tsx b/front/views/Home.tsx
index 4792f5f..6801e2d 100644
--- a/front/views/Home.tsx
+++ b/front/views/Home.tsx
@@ -7,11 +7,20 @@ interface Tactic {
creation_date : string
}
-export default function Home({ lastTactics, allTactics } : { lastTactics : Tactic[] , allTactics : Tactic[]}) {
+interface Team {
+ id : number
+ name : string
+ picture : string
+ main_color : string
+ second_color : string
+}
+
+export default function Home({ lastTactics, allTactics, teams } : { lastTactics : Tactic[] , allTactics : Tactic[], teams : Team[]}) {
+ console.log(teams);
return (
-
+
)
}
@@ -24,25 +33,25 @@ export function Title() {
)
}
-export function Body({ lastTactics, allTactics } : { lastTactics : Tactic[], allTactics : Tactic[]}) {
- const widthPersonalSpace = 67.5;
+export function Body({ lastTactics, allTactics, teams } : { lastTactics : Tactic[], allTactics : Tactic[], teams : Team[]}) {
+ const widthPersonalSpace = 80;
const widthSideMenu = 100-widthPersonalSpace
return (
)
}
-export function SideMenu({ width, lastTactics } : { width : number, lastTactics : Tactic[] }) {
+export function SideMenu({ width, lastTactics, teams } : { width : number, lastTactics : Tactic[], teams : Team[]}) {
return (
)
@@ -110,11 +119,24 @@ function BodyPersonalSpace({ allTactics } : { allTactics : Tactic[]}) {
)
}
-export function Team() {
+export function Team({teams} : {teams : Team[]}) {
+ const listTeam = teams.map((team, rowIndex) =>
+
+ {team.name}
+
+
+ );
return (
-
-
Mes équipes
-
+
+
+
Mes équipes
+
+
+
)
}
@@ -132,7 +154,7 @@ export function Tactic({lastTactics} : { lastTactics : Tactic[]}) {
return (
-
Mes cinq dernières stratégies
+ Mes dernières stratégies
diff --git a/src/App/Controller/UserController.php b/src/App/Controller/UserController.php
index f2444a5..9dcfad5 100644
--- a/src/App/Controller/UserController.php
+++ b/src/App/Controller/UserController.php
@@ -35,10 +35,14 @@ class UserController {
if ($this->teams != NULL) {
$teams = $this->teams->getAll($session->getAccount()->getId());
}
+ else {
+ $teams = [];
+ }
return ViewHttpResponse::react("views/Home.tsx", [
"lastTactics" => $lastTactics,
- "allTactics" => $allTactics
+ "allTactics" => $allTactics,
+ "teams" => $teams
]);
// return ViewHttpResponse::react("views/Home.tsx", []);
}