set opponents colors to orange
continuous-integration/drone/push Build is passing Details

pull/11/head
maxime.batista 1 year ago
parent 7cf719e7cb
commit 0430c76c51

@ -14,6 +14,7 @@ export function BasketCourt({players, onPlayerRemove}: { players: Player[], onPl
return ( return (
<CourtPlayer key={player.id} <CourtPlayer key={player.id}
pos={player.position} pos={player.position}
team={player.team}
x={(bounds.width * player.right_percentage)} x={(bounds.width * player.right_percentage)}
y={(bounds.height * player.bottom_percentage)} y={(bounds.height * player.bottom_percentage)}
bounds={{bottom: bounds.height, top: 0, left: 0, right: bounds.width}} bounds={{bottom: bounds.height, top: 0, left: 0, right: bounds.width}}

@ -6,6 +6,7 @@ import {PlayerPiece} from "./PlayerPiece";
export interface PlayerOptions { export interface PlayerOptions {
pos: string, pos: string,
team: string,
x: number, x: number,
y: number, y: number,
bounds: DraggableBounds, bounds: DraggableBounds,
@ -15,7 +16,7 @@ export interface PlayerOptions {
/** /**
* A player that is placed on the court, which can be selected, and moved in the associated bounds * A player that is placed on the court, which can be selected, and moved in the associated bounds
* */ * */
export default function CourtPlayer({pos, x, y, bounds, onRemove}: PlayerOptions) { export default function CourtPlayer({pos, team, x, y, bounds, onRemove}: PlayerOptions) {
const ref = useRef<HTMLDivElement>(null); const ref = useRef<HTMLDivElement>(null);
return ( return (
@ -42,7 +43,7 @@ export default function CourtPlayer({pos, x, y, bounds, onRemove}: PlayerOptions
className="player-selection-tab-remove" className="player-selection-tab-remove"
onClick={() => onRemove()}/> onClick={() => onRemove()}/>
</div> </div>
<PlayerPiece text={pos}/> <PlayerPiece team={team} text={pos}/>
</div> </div>
</div> </div>

@ -2,9 +2,9 @@ import React from "react";
import '../../style/player.css' import '../../style/player.css'
export function PlayerPiece({text}: { text: string }) { export function PlayerPiece({team, text}: { team: string, text: string }) {
return ( return (
<div className="player-piece"> <div className={`player-piece ${team}`}>
<p>{text}</p> <p>{text}</p>
</div> </div>
) )

@ -35,6 +35,10 @@
margin-left: 5px; margin-left: 5px;
} }
.player-piece.opponents {
background-color: #f59264;
}
#court-div { #court-div {
background-color: var(--background-color); background-color: var(--background-color);
height: 100%; height: 100%;

@ -123,3 +123,4 @@ export default function Editor({id, name}: { id: number, name: string }) {
</div> </div>
) )
} }

Loading…
Cancel
Save