From c3ae661d2b0972b3c8670385f056bcbc9e38d5bb Mon Sep 17 00:00:00 2001 From: d_yanis Date: Sun, 7 Jan 2024 22:31:15 +0100 Subject: [PATCH] WIP --- front/views/Home.tsx | 7 ++++--- src/App/Controller/UserController.php | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/front/views/Home.tsx b/front/views/Home.tsx index a4f7b8e..e564964 100644 --- a/front/views/Home.tsx +++ b/front/views/Home.tsx @@ -17,16 +17,16 @@ interface Team { second_color : string } -export default function Home({ lastTactics, allTactics, teams } : { lastTactics : Tactic[] , allTactics : Tactic[], teams : Team[]}) { +export default function Home({ lastTactics, allTactics, teams, username } : { lastTactics : Tactic[] , allTactics : Tactic[], teams : Team[], username : string}) { return (
- + <Title username={username}/> <Body lastTactics={lastTactics} allTactics={allTactics} teams={teams}/> </div> ) } -export function Title() { +export function Title({username} : {username : string}) { return ( <div id="header"> <div id="header-left"> @@ -37,6 +37,7 @@ export function Title() { </div> <div id="header-right"> <img id="img-account" src="account.svg" color="white"/> + {username} </div> </div> ) diff --git a/src/App/Controller/UserController.php b/src/App/Controller/UserController.php index 9dcfad5..889efa6 100644 --- a/src/App/Controller/UserController.php +++ b/src/App/Controller/UserController.php @@ -30,7 +30,8 @@ class UserController { $limitNbTactics = 5; $lastTactics = $this->tactics->getLast($limitNbTactics, $session->getAccount()->getId()); $allTactics = $this->tactics->getAll($session->getAccount()->getId()); - + $name = $session->getAccount()->getName(); + //TODO if ($this->teams != NULL) { $teams = $this->teams->getAll($session->getAccount()->getId()); @@ -42,7 +43,8 @@ class UserController { return ViewHttpResponse::react("views/Home.tsx", [ "lastTactics" => $lastTactics, "allTactics" => $allTactics, - "teams" => $teams + "teams" => $teams, + "username" => $name ]); // return ViewHttpResponse::react("views/Home.tsx", []); }