Add the display of tactic name
continuous-integration/drone/push Build is failing Details

pull/81/head
d_yanis 1 year ago
parent 86230fc702
commit 5668519c33

@ -0,0 +1,10 @@
/* #header {
background-color: var(--white);
transition: box-shadow .3s linear;
outline: 0;
box-shadow: 0 10px 15px #00000026;
} */
#header {
}

@ -1,5 +0,0 @@
#main {
margin-left:10%;
margin-right:10%;
background-color: grey;
}

@ -1,10 +0,0 @@
#titreTactic {
background-color: red;
padding-right : 10px;
margin-top : 10px;
}
#titreTactic h2 {
display: inline;
padding-right : 25px;
}

@ -1,15 +0,0 @@
#IQ {
color : red;
}
#B {
color : blue;
}
#IQBall {
text-align: center;
}
#title {
background-color: aqua;
}

@ -1,19 +1,30 @@
import "../style/home/global.css"
import "../style/home/tactic.css"
import "../style/home/titre.css"
import "../style/home.css"
export default function Home() {
interface Tactic {
id : number
name : string
creationDate : number
}
export default function Home({
tactics
} : {
tactics : Tactic[]
}) {
console.log(tactics);
return (
<div id="main">
<Title/>
<Body/>
{tactics.map(tactic => (
<div>{tactic.name}</div>
))}
</div>
)
}
export function Title() {
return (
<div id="title">
<div id="header">
<h1 id="IQBall"><span id="IQ">IQ</span><span id="B">B</span>all</h1>
<img src=""></img>
</div>

@ -22,7 +22,10 @@ class UserController {
*/
public function home(SessionHandle $session): ViewHttpResponse {
$lastTactic = $this->tactics->getLast(5);
return ViewHttpResponse::react("views/Home.tsx", $this->listTacticToJson($lastTactic));
return ViewHttpResponse::react("views/Home.tsx", [
"tactics" => $lastTactic
]);
// return ViewHttpResponse::react("views/Home.tsx", []);
}
private function listTacticToJson(array $listTactic) : array {
@ -36,7 +39,7 @@ class UserController {
];
array_push($jsonReturn, $jsonTactic);
}
var_dump($jsonReturn);
// var_dump($jsonReturn);
return $jsonReturn;
}

Loading…
Cancel
Save