applied reviews changes

pull/84/head
Maël DAIM 1 year ago
parent 1efec8c0d9
commit 00efd0f43d

@ -1,11 +1,11 @@
#mainDiv { #main-div {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
height: 100%; height: 100%;
} }
header { #main-div header {
display: flex; display: flex;
justify-content: center; justify-content: center;
background-color: #525252; background-color: #525252;
@ -25,11 +25,7 @@ header h1 a {
border: 2px white solid; border: 2px white solid;
} }
#main_color { #team-info {
border: solid;
}
#teamInfo {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -39,13 +35,13 @@ header h1 a {
border-radius: 10px; border-radius: 10px;
} }
#firstPart { #first-part {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
#teamName { #team-name {
font-size: 2.8em; font-size: 2.8em;
} }
@ -67,7 +63,7 @@ header h1 a {
color: white; color: white;
} }
#actualColors { #actual-colors {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-around; justify-content: space-around;
@ -97,21 +93,21 @@ header h1 a {
margin-bottom: 10px; margin-bottom: 10px;
} }
#headMembers { #head-members {
width: 33%; width: 33%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-evenly; justify-content: space-evenly;
} }
#addMember { #add-member {
height: 30px; height: 30px;
aspect-ratio: 1/1; aspect-ratio: 1/1;
border-radius: 100%; border-radius: 100%;
align-self: center; align-self: center;
} }
#Members { #members {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background-color: #bcbcbc; background-color: #bcbcbc;
@ -121,7 +117,7 @@ header h1 a {
border-radius: 10px; border-radius: 10px;
} }
.Member { .member {
width: 60%; width: 60%;
background-color: white; background-color: white;
display: flex; display: flex;
@ -133,7 +129,7 @@ header h1 a {
margin-bottom: 5px; margin-bottom: 5px;
} }
#profilePicture { #profile-picture {
height: 40px; height: 40px;
width: 40px; width: 40px;
} }

@ -12,7 +12,7 @@ export default function TeamPanel({
currentUserId: number currentUserId: number
}) { }) {
return ( return (
<div id="mainDiv"> <div id="main-div">
<header> <header>
<h1> <h1>
<a href={BASE + "/"}>IQBall</a> <a href={BASE + "/"}>IQBall</a>
@ -34,9 +34,9 @@ export default function TeamPanel({
function TeamDisplay({ team }: { team: TeamInfo }) { function TeamDisplay({ team }: { team: TeamInfo }) {
return ( return (
<div id="teamInfo"> <div id="team-info">
<div id="firstPart"> <div id="first-part">
<h1 id="teamName">{team.name}</h1> <h1 id="team-name">{team.name}</h1>
<img id="logo" src={team.picture} alt="Logo d'équipe" /> <img id="logo" src={team.picture} alt="Logo d'équipe" />
</div> </div>
<div id="colors"> <div id="colors">
@ -44,7 +44,7 @@ function TeamDisplay({ team }: { team: TeamInfo }) {
<p>Couleur principale</p> <p>Couleur principale</p>
<p>Couleur secondaire</p> <p>Couleur secondaire</p>
</div> </div>
<div id="actualColors"> <div id="actual-colors">
<ColorDisplay color={team.mainColor} /> <ColorDisplay color={team.mainColor} />
<ColorDisplay color={team.secondColor} /> <ColorDisplay color={team.secondColor} />
</div> </div>
@ -100,12 +100,12 @@ function MembersDisplay({
/> />
)) ))
return ( return (
<div id="Members"> <div id="members">
<div id="headMembers"> <div id="head-members">
<h2>Membres :</h2> <h2>Membres :</h2>
{isCoach && ( {isCoach && (
<button <button
id="addMember" id="add-member"
onClick={() => onClick={() =>
(window.location.href = `${BASE}/team/${idTeam}/addMember`) (window.location.href = `${BASE}/team/${idTeam}/addMember`)
}> }>
@ -130,9 +130,9 @@ function MemberDisplay({
currentUserId: number currentUserId: number
}) { }) {
return ( return (
<div className="Member"> <div className="member">
<img <img
id="profilePicture" id="profile-picture"
src={member.user.profilePicture} src={member.user.profilePicture}
alt="Photo de profile" alt="Photo de profile"
/> />

@ -121,7 +121,7 @@ function runMatch($match, MutableSessionHandle $session): HttpResponse {
], HttpCodes::NOT_FOUND); ], HttpCodes::NOT_FOUND);
} }
return App::runAction('/login', $match['target'], $match['params'], $session); return App::runAction($basePath . '/login', $match['target'], $match['params'], $session);
} }
//this is a global variable //this is a global variable

@ -127,20 +127,19 @@ class TeamController {
return ViewHttpResponse::twig('error.html.twig', [ return ViewHttpResponse::twig('error.html.twig', [
'failures' => [ValidationFail::unauthorized("Vous n'avez pas accès à cette équipe.")], 'failures' => [ValidationFail::unauthorized("Vous n'avez pas accès à cette équipe.")],
], HttpCodes::FORBIDDEN); ], HttpCodes::FORBIDDEN);
} else {
$role = $this->model->isCoach($id, $session->getAccount()->getUser()->getEmail());
return ViewHttpResponse::react(
'views/TeamPanel.tsx',
[
'team' => [
"info" => $result->getInfo(),
"members" => $result->listMembers(),
],
'isCoach' => $role,
'currentUserId' => $session->getAccount()->getUser()->getId()]
);
} }
$role = $this->model->isCoach($id, $session->getAccount()->getUser()->getEmail());
return ViewHttpResponse::react(
'views/TeamPanel.tsx',
[
'team' => [
"info" => $result->getInfo(),
"members" => $result->listMembers(),
],
'isCoach' => $role,
'currentUserId' => $session->getAccount()->getUser()->getId()]
);
} }
/** /**

Loading…
Cancel
Save