diff --git a/front/components/editor/BallPiece.tsx b/front/components/editor/BallPiece.tsx index d27c407..b09f811 100644 --- a/front/components/editor/BallPiece.tsx +++ b/front/components/editor/BallPiece.tsx @@ -3,13 +3,6 @@ import "../../style/ball.css" import BallSvg from "../../assets/icon/ball.svg?react" import { Ball } from "../../tactic/CourtObjects" -export interface CourtBallProps { - onMoved: (rect: DOMRect) => void - onRemove: () => void - ball: Ball -} - export function BallPiece() { return } - diff --git a/front/components/editor/BasketCourt.tsx b/front/components/editor/BasketCourt.tsx index aa7458f..4545f9a 100644 --- a/front/components/editor/BasketCourt.tsx +++ b/front/components/editor/BasketCourt.tsx @@ -22,15 +22,15 @@ export interface BasketCourtProps { } export function BasketCourt({ - players, - objects, - onPlayerRemove, - onBallRemove, - onBallMoved, - onPlayerChange, - courtImage, - courtRef, - }: BasketCourtProps) { + players, + objects, + onPlayerRemove, + onBallRemove, + onBallMoved, + onPlayerChange, + courtImage, + courtRef, +}: BasketCourtProps) { return (
) -} \ No newline at end of file +} diff --git a/front/components/editor/CourtBall.tsx b/front/components/editor/CourtBall.tsx index f2c32e6..9ba5ae5 100644 --- a/front/components/editor/CourtBall.tsx +++ b/front/components/editor/CourtBall.tsx @@ -1,6 +1,13 @@ import React, { useRef } from "react" import Draggable from "react-draggable" -import { BallPiece, CourtBallProps } from "./BallPiece" +import { BallPiece } from "./BallPiece" +import { Ball } from "../../tactic/CourtObjects" + +export interface CourtBallProps { + onMoved: (rect: DOMRect) => void + onRemove: () => void + ball: Ball +} export function CourtBall({ onMoved, ball, onRemove }: CourtBallProps) { const pieceRef = useRef(null) diff --git a/front/components/editor/CourtPlayer.tsx b/front/components/editor/CourtPlayer.tsx index a5f9c51..5f152ed 100644 --- a/front/components/editor/CourtPlayer.tsx +++ b/front/components/editor/CourtPlayer.tsx @@ -18,12 +18,12 @@ export interface PlayerProps { * A player that is placed on the court, which can be selected, and moved in the associated bounds * */ export default function CourtPlayer({ - player, - onChange, - onRemove, - onBallDrop, - parentRef, - }: PlayerProps) { + player, + onChange, + onRemove, + onBallDrop, + parentRef, +}: PlayerProps) { const pieceRef = useRef(null) const ballPiece = useRef(null) @@ -91,4 +91,4 @@ export default function CourtPlayer({
) -} \ No newline at end of file +} diff --git a/front/style/ball.css b/front/style/ball.css index 6a30738..c14c196 100644 --- a/front/style/ball.css +++ b/front/style/ball.css @@ -9,8 +9,3 @@ height: 20px; cursor: pointer; } - -.ball-div:focus-within { - -} - diff --git a/front/style/editor.css b/front/style/editor.css index 7b299de..a7e72f9 100644 --- a/front/style/editor.css +++ b/front/style/editor.css @@ -45,21 +45,20 @@ height: 100%; } -#allies-rack { +#allies-rack, +#opponent-rack { width: 125px; min-width: 125px; display: flex; flex-direction: row; align-items: flex-end; +} + +#allies-rack { justify-content: flex-start; } #opponent-rack { - width: 125px; - min-width: 125px; - display: flex; - flex-direction: row; - align-items: flex-end; justify-content: flex-end; } @@ -116,4 +115,4 @@ .save-state-saving, .save-state-guest { color: gray; -} \ No newline at end of file +} diff --git a/front/tactic/CourtObjects.ts b/front/tactic/CourtObjects.ts index 52161cc..28e4830 100644 --- a/front/tactic/CourtObjects.ts +++ b/front/tactic/CourtObjects.ts @@ -14,4 +14,4 @@ export interface Ball { * Percentage of the player's position to the right (0 means left, 1 means right, 0.5 means middle) */ readonly rightRatio: number -} \ No newline at end of file +} diff --git a/front/tactic/Tactic.ts b/front/tactic/Tactic.ts index 726825b..8e06331 100644 --- a/front/tactic/Tactic.ts +++ b/front/tactic/Tactic.ts @@ -10,4 +10,4 @@ export interface Tactic { export interface TacticContent { players: Player[] objects: CourtObject[] -} \ No newline at end of file +} diff --git a/front/views/Editor.tsx b/front/views/Editor.tsx index 97fa89e..7e7e8f3 100644 --- a/front/views/Editor.tsx +++ b/front/views/Editor.tsx @@ -13,7 +13,6 @@ import { BasketCourt } from "../components/editor/BasketCourt" import plainCourt from "../assets/court/full_court.svg" import halfCourt from "../assets/court/half_court.svg" - import { BallPiece } from "../components/editor/BallPiece" import { Rack } from "../components/Rack" @@ -30,8 +29,7 @@ import SavingState, { SaveStates, } from "../components/editor/SavingState" -import {CourtObject} from "../tactic/CourtObjects"; - +import { CourtObject } from "../tactic/CourtObjects" const ERROR_STYLE: CSSProperties = { borderColor: "red", @@ -64,14 +62,7 @@ interface RackedPlayer { type RackedCourtObject = { key: "ball" } - -export default function Editor({ - id, - name, - courtType, - content, - }: EditorProps) { - +export default function Editor({ id, name, courtType, content }: EditorProps) { const isInGuestMode = id == -1 const storage_content = localStorage.getItem(GUEST_MODE_CONTENT_STORAGE_KEY) @@ -116,11 +107,11 @@ export default function Editor({ } function EditorView({ - tactic: { id, name, content: initialContent }, - onContentChange, - onNameChange, - courtType, - }: EditorViewProps) { + tactic: { id, name, content: initialContent }, + onContentChange, + onNameChange, + courtType, +}: EditorViewProps) { const isInGuestMode = id == -1 const [titleStyle, setTitleStyle] = useState({}) @@ -143,7 +134,6 @@ function EditorView({ const courtDivContentRef = useRef(null) - const isBoundsOnCourt = (bounds: DOMRect) => { const courtBounds = courtDivContentRef.current!.getBoundingClientRect() @@ -209,12 +199,12 @@ function EditorView({ } }) return - } else { - courtObject = { - type: "ball", - rightRatio: x, - bottomRatio: y, - } + } + + courtObject = { + type: "ball", + rightRatio: x, + bottomRatio: y, } break @@ -359,9 +349,7 @@ function EditorView({
- - - +
gateway->getHash($email); if ($hash == null or (!password_verify($password, $hash))) { - $failures[] = new ValidationFail("email","Adresse email ou mot de passe invalide"); + $failures[] = new ValidationFail("email", "Adresse email ou mot de passe invalide"); return null; } return $this->gateway->getAccountFromMail($email);