apply suggestions
continuous-integration/drone/push Build is passing Details

pull/11/head
maxime.batista 1 year ago
parent c53a1b024c
commit a18014d4c3

@ -10,10 +10,8 @@ export interface BasketCourtProps {
}
export function BasketCourt({players, onPlayerRemove}: BasketCourtProps) {
const divRef = useRef<HTMLDivElement>(null);
return (
<div id="court-container" ref={divRef} style={{position: "relative"}}>
<div id="court-container" style={{position: "relative"}}>
<CourtSvg id="court-svg"/>
{players.map(player => {
return <CourtPlayer key={player.id}

@ -15,19 +15,15 @@ export interface PlayerProps {
* */
export default function CourtPlayer({player, onRemove}: PlayerProps) {
const ref = useRef<HTMLDivElement>(null);
const x = player.rightRatio;
const y = player.bottomRatio;
return (
<Draggable
handle={".player-piece"}
nodeRef={ref}
bounds="parent"
>
<div ref={ref}
className={"player"}
<div className={"player"}
style={{
position: "absolute",
left: `${x * 100}%`,

@ -1,4 +1,4 @@
import {CSSProperties, ReactElement, RefObject, useRef, useState} from "react";
import {CSSProperties, useRef, useState} from "react";
import "../style/editor.css";
import TitleInput from "../components/TitleInput";
import {API} from "../Constants";

Loading…
Cancel
Save